Finalized in Java 15 (JEP 378). Available in all Java 15+ releases, including Java 17. Previous previews: Java 13 (JEP 355) and Java 14 (JEP 368). The Problem: Embedded Strings in Java Writing multi-line strings in Java has always been painful: // JSON — a wall of escape sequences and concatenation String json = "{\n" + " \"name\": \"Alice\",\n" + " \"role\": \"engineer\",\n" + " \"active\": true\n" + "}"; // SQL — unreadable indentation and newlines String sql = "SELECT u.
Continue reading »Jep378
1 post in this section