Represents a character string of almost arbitrary length (limited only by memory restrictions). String constants consist of UNICODE characters encoded in UTF8. They are enclosed in double quotes.
The backslash in string can be used to mark special characters:
Representation | Meaning |
---|---|
\n | Newline (ASCII 10) |
\t | Tabulator |
\r | Carriage Return (ASCII 13) |
\b | Backspace |
\f | Form Feed |
\ abc | ASCII character represented by the octal value abc. Note that unlike in C, there must be exactly 3 octal digits! |
\ X | The character X itself. |
A backslash followed by a newline makes both the backslash and the
newline being ignored. Thus you can split a string constant over
multiple lines in the YCP
code.
Example 2.4. String constants
“This string ends with a newline character.\n” “This is also a newline: \012”