Skip to main content
Version: 1.5.0

Verbatim

Strings can contain control characters, like \n. Sometimes we need that each character in a string is interpreted on its own, for example \n as two characters instead of a newline character. In that case, either we escape the backslash character, or we use verbatim strings. Those have the same type string as normal (that is, interpreted) strings.

Verbatim strings are given between backquotes (a.k.a. backticks), instead of double quotes:

const s : string = `\n` // String made of two characters

Note: See predefined namespace String