Java 13 introduces text blocks as a preview feature (JEP 355), allowing string literals to span multiple lines. The guide covers syntax rules (opening delimiter must be followed by a newline, closing delimiter placement affects trailing newlines and indentation), how the compiler strips incidental whitespace while preserving essential indentation, escape sequence handling, and LF normalization across platforms. New String methods added in Java 12/13 are also explained: stripIndent, indent, translateEscapes, and formatted. The author recommends letting the formatter place the closing delimiter naturally and adjusting content indentation rather than following JEP 355's suggested alignment style.
Table of contents
▚ Text Block Syntax▚ Delimiter Semantics ...▚ ... and Indentation▚ Odds and ends▚ ReflectionSort: