Strings are created by enclosing Unicode characters in double quotes. You Strings are UTF-8 encoded. The empty string is falsey.
Special characters
The only special character is "
. You can put a double quote inside a string by escaping it with a backslash:
Code Block | |
---|---|
javascript | |
theme | Confluence | a = "I can put a quote character, \", in my string using a backslash" |
Strings can span multiple linesA backslash is escaped with another one:
Code Block | ||||
---|---|---|---|---|
| ||||
ab = "howI tocan addend a'my 'string character"with // -> "how to add a \n character" |
...
a \\" |
A newline (\n) requires a line break:
Code Block |
---|
c = "And include a '
' too!" |
Other characters can be inserted literally (some text editors are better at this than others), or consider using chr().