Skip to content

Commit 9f8490f

Browse files
authored
Improve \ in string literal to show both effects (#50820)
1 parent 4a7d3db commit 9f8490f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/fsharp/language-reference/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let xmlFragment1 = @"<book author=""Milton, John"" title=""Paradise Lost"">"
5050
let xmlFragment2 = """<book author="Milton, John" title="Paradise Lost">"""
5151
```
5252

53-
In code, strings that have line breaks are accepted and the line breaks are interpreted as the newline encoding used in source, unless a backslash character is the last character before the line break. Leading white space on the next line is ignored when the backslash character is used. The following code produces a string `str1` that has value `"abc\ndef"` and a string `str2` that has value `"abcdef"`.
53+
In code, strings that have line breaks are accepted and the line breaks are interpreted as the newline encoding used in source, unless a backslash character is the last character before the line break. Leading white space on the next line is ignored when the backslash character is used. The following code produces a string `str1` that has value `"abc\n def"` and a string `str2` that has value `"abcdef"`.
5454

5555
[!code-fsharp[Main](~/samples/snippets/fsharp/lang-ref-1/snippet1001.fs)]
5656

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let str1 =
22
"abc
3-
def"
3+
def"
44

55
let str2 =
66
"abc\
7-
def"
7+
def"

0 commit comments

Comments
 (0)