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 →
Related concepts
- docstringused by · A docstring is a string literal associated with a program element that documents its purpose, interface, behavior, or usage for people and tools.
- regular expressionused by · A formal pattern notation that describes sets of strings and enables text to be matched, searched, extracted, or transformed.
- stringimplements · A string is a programming-language value representing an ordered sequence of characters or character units as text.
- 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 source-code notation that directly represents a string value.
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.


