VocabularysyntaxSyntax"string..."
"""string..."""
Inputs and outputs| string | literal and escaped characters |
Word descriptionReads from the input string until the next occurrence of
" or
""", and appends the resulting string to the parse tree. String literals can span multiple lines. Various special characters can be read by inserting
Character escape codes. For triple quoted strings, the double-quote character does not require escaping.
ExamplesA string with an escaped newline in it:
USE: io
"Hello\nworld" print
Hello
world
A string with an actual newline in it:
USE: io
"Hello
world" print
Hello
world
A string with a named Unicode code point:
USE: io
"\u{greek-capital-letter-sigma}" print
Σ
A triple-quoted string:
USE: io """Teach a man to "fish"...
and fish will go extinct""" print
Teach a man to "fish"...
and fish will go extinct
Definition