Skip to content

Commit 90584a9

Browse files
stevengjtkelman
authored andcommitted
document newline normalization in literal strings (#14073)
(cherry picked from commit 9ac2fd5) ref #14078
1 parent 92ad061 commit 90584a9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/manual/strings.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ backslash:
441441
julia> print("I have \$100 in my account.\n")
442442
I have $100 in my account.
443443

444-
Triple-Quoted Strings Literals
445-
------------------------------
444+
Triple-Quoted String Literals
445+
-----------------------------
446446

447447
When strings are created using triple-quotes (``"""..."""``) they have some
448448
special behavior that can be useful for creating longer blocks of text. First,
@@ -484,6 +484,12 @@ defining strings within code that is indented. For example:
484484
In this case the final (empty) line before the closing ``"""`` sets the
485485
indentation level.
486486

487+
Note that line breaks in literal strings, whether single- or triple-quoted,
488+
result in a newline (LF) character ``\n`` in the string, even if your
489+
editor uses a carriage return ``\r`` (CR) or CRLF combination to end lines.
490+
To include a CR in a string, use an explicit escape ``\r``; for example,
491+
you can enter the literal string ``"a CRLF line ending\r\n"``.
492+
487493
Common Operations
488494
-----------------
489495

0 commit comments

Comments
 (0)