Skip to content

Commit 6947cdb

Browse files
committed
End-of-line backslash in string #22698
1 parent a62e5e6 commit 6947cdb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/doc/trpl/hello-world.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ Next, `"Hello, world!"` is a *string*. Strings are a surprisingly complicated
106106
topic in a systems programming language, and this is a *statically allocated*
107107
string. We will talk more about different kinds of allocation later. We pass
108108
this string as an argument to `println!`, which prints the string to the
109-
screen. Easy enough!
109+
screen. Easy enough! You could also split the string into multiple lines with the '\'
110+
character, like so:
111+
112+
```{rust}
113+
println!("Hello, \
114+
World!");
115+
````
110116
111117
Finally, the line ends with a semicolon (`;`). Rust is an *expression
112118
oriented* language, which means that most things are expressions. The `;` is

0 commit comments

Comments
 (0)