"
Factor handbook » The language » Syntax » Literals » Character and string syntax

Prev:CHAR:
Next:Character escape codes


Vocabulary
syntax

Syntax
"string..."


Inputs
None

Outputs
None

Word description
Reads from the input string until the next occurrence of ", 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.

Examples
A 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
Σ


Definition