diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 11:43:24 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 20:37:39 +0530 |
| commit | 08c25f37df936cf08cefd92baf08da9d0e2a1e09 (patch) | |
| tree | 527f6e89036d501b6306c022ab4bcb4fe8ae846b /src | |
| parent | c46fe78c32ac313e0c837519bd38c59b029f5a0a (diff) | |
| parent | f618e2e1ec1d6b9f0b5c110f0dbfa385f3b583d3 (diff) | |
| download | rust-08c25f37df936cf08cefd92baf08da9d0e2a1e09.tar.gz rust-08c25f37df936cf08cefd92baf08da9d0e2a1e09.zip | |
Rollup merge of #22748 - jxcl:string-backslash, r=steveklabnik
r? @steveklabnik Closes #22698 I wasn't sure that this was appropriate for the book, but I've added this to the reference. I also noticed that one of the U+ symbols in the character literals section was missing the graves.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/reference.md | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 781b40be768..87130c08991 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -302,7 +302,7 @@ nonzero_dec: '1' | '2' | '3' | '4' A _character literal_ is a single Unicode character enclosed within two `U+0027` (single-quote) characters, with the exception of `U+0027` itself, -which must be _escaped_ by a preceding U+005C character (`\`). +which must be _escaped_ by a preceding `U+005C` character (`\`). ##### String literals @@ -311,6 +311,19 @@ A _string literal_ is a sequence of any Unicode characters enclosed within two which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw string literal_. +A multi-line string literal may be defined by terminating each line with a +`U+005C` character (`\`) immediately before the newline. This causes the +`U+005C` character, the newline, and all whitespace at the beginning of the +next line to be ignored. + +```rust +let a = "foobar"; +let b = "foo\ + bar"; + +assert_eq!(a,b); +``` + ##### Character escapes Some additional _escapes_ are available in either character or non-raw string |
