Skip to content

Commit 532642f

Browse files
committed
Clarify escaped newlines in tutorial
Closes #1117
1 parent bd16aac commit 532642f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/tutorial/syntax.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,12 @@ character escapes, using the backslash character:
240240
String literals allow the same escape sequences. They are written
241241
between double quotes (`"hello"`). Rust strings may contain newlines.
242242
When a newline is preceded by a backslash, it, and all white space
243-
following it, will not appear in the resulting string literal.
243+
following it, will not appear in the resulting string literal. So
244+
this is equivalent to `"abc"`:
245+
246+
let s = "a\
247+
b\
248+
c";
244249

245250
## Operators
246251

0 commit comments

Comments
 (0)