Strings must be enclosed in double quotes, e.g.,
"A short String." "" // empty string
Strings may contain escape sequences which must be specified by a leading backslash ( ). A list of valid escape sequences is given below.
|
Escape sequence | Description |
a | bell |
b | backspace |
f | formfeed |
n | newline |
r | carriage return |
t | horizontal tab |
v | vertical tab |
backslash | |
" | double quote |
xnn | ASCII code given by a hexadecimal number nn |
ooo | ASCII code given by an octal number ooo |
For instance:
"1st line\n2nd line" // two lines
Strings can also be given piecewise. This can be useful to specify very long strings which exceed the width of the editor window. To make clear what parts of strings belong together and to avoid ambiguities in the examples below parentheses are added, e.g.,
("This is a single string specified at once.") // a single string ("This is a single string " "specified by two parts.") // a single string too ("This " "is a " "single string") // again a single string
Robert Klima 2003-02-06