Escaping special characters in strings
In Gosu strings, the backslash character (\) indicates that the immediately
following character requires special handling. Because the backslash
is used to “escape” the usual meaning of the character in the string,
the backslash is called an escape character.
The combination of the backslash and its following character is called
an escape sequence.
For example, you use the backslash escape character to insert a quotation mark into a string without terminating the string. The following list describes some common uses for the backslash in Gosu strings.
Sequence |
Result |
|---|---|
|
Inserts a backslash into the string without forcing an escape sequence. |
|
Inserts a double-quotation mark into the string without terminating it. Note: This escape sequence is not used in embedded code inside Gosu templates. In such cases, do not escape
the quotation mark characters. |
|
Inserts a new line into the string so that the remainder of the text begins on a new line if printed. |
|
Inserts a tab into the string to add horizontal space in the line if printed. |
Examples
Claim["ClaimNumber"]
var address = "123 Main Street"
"LOGGING: \n\"Global Activity Assignment Rules\""
See also
