Multiline string
A multiline string is a string literal or value whose text or source representation spans multiple lines.
Kotlin in Action, 2E
A triple-quoted string is a Kotlin string literal delimited by three quotation marks that preserves line breaks and does not interpret ordinary escape sequences.
- How it is used
- Embeds readable multiline content, regular expressions, paths, ASCII art, and expected test output.
- How deep it goes
- Explains delimiters, indentation cleanup, line endings, escape limitations, templates, and test usage without descending into compiler internals.
- Examples
- Uses path-matching patterns, ASCII art, Windows paths, HTML, JSON, and expected multiline test output.
- What you can do after
- Build readable Kotlin literals for multiline text, regular expressions, paths, and expected structured output.
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A string literal form whose source text may span multiple lines, preserving line breaks and other whitespace in the literal text.
- How it is used
- Uses multiline template literals to make longer strings, especially product HTML, easier to read than concatenated strings.
- How deep it goes
- Defines multiline literals, distinguishes them from newline escapes, and demonstrates the resulting line break without exploring implementation internals.
- Examples
- Shows a two-line greeting and product HTML formatted across multiple lines.
- What you can do after
- Apply template literal syntax to write strings that span source lines, including readable HTML markup.
Get Programming: Learn to code with Python
- How it is used
- Uses triple-quoted strings to store multiline word data and write function documentation.
- How deep it goes
- Explains delimiters and embedded line breaks, then shows newline-based parsing and docstring structure.
- Examples
- Shows an art-word list, newline scanning, and a function docstring as concrete multiline-string examples.
- What you can do after
- Apply triple quotes to store multiline data or document a function with a readable docstring.
Read how Get Programming: Learn to code with Python explains multiline string →
Also covered in
- Julia as a Second Language
- Tiny Python Projects: Learn coding and testing with puzzles and games
- Rust in Action: Systems programming concepts and techniques
- The Quick Python Book, Fourth Edition
- Python How-To
- Systems Programming with ZigIn early access (MEAP)
- 100 Java Mistakes and How to Avoid Them
What to know first
- stringA string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
- newlineA newline is a character or character sequence that marks the boundary between consecutive lines of text.
- concatenationConcatenation is the operation of joining ordered sequences end to end, or along a specified dimension, to form a combined sequence or structure.
- escape sequenceAn escape sequence is source notation using a marker to change how following characters are interpreted, often representing a special character or control value or making syntax literal.
Related concepts
- docstringused by · A docstring is a string literal associated with a program element that documents its purpose, interface, or behavior for people or tools.
- regular expressionused by · A regular expression is a formal pattern notation that describes sets of strings and specifies how text can be matched, searched, or transformed.
- stringkind of · A string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
- newlineuses · A newline is a character or character sequence that marks the boundary between consecutive lines of text.
- string literalkind of · A string literal is a fixed sequence of text characters written directly in a programming or data-language expression as a string value, rather than computed from other data.
Questions about multiline string
What is multiline string?
A multiline string is a string literal or value whose text or source representation spans multiple lines.
Which Manning books explain multiline string?
Kotlin in Action, 2E, Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond and Get Programming: Learn to code with Python.
What should I know before learning multiline string?
Manning books that teach multiline string usually introduce string, newline, concatenation and escape sequence first.
What is multiline string a kind of?
Multiline string is a kind of string. A string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
What is multiline string also called?
Multiline string is also called triple-quoted string or triple quotes.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


