contents   index   previous   next



Escape sequences for characters

Some characters, such as a quotation mark, have special meaning to the interpreter and must be indicated with special character combinations when used in strings. This allows the interpreter to distinguish between a quotation mark that is part of a string and a quotation mark that indicates the end of the string. The table below lists the characters indicated by escape sequences:

 

\a Audible bell

\b Backspace

\f Formfeed

\n Newline

\r Carriage return

\t Horizontal Tab

\v Vertical tab

\' Single quote

\" Double quote

\\ Backslash character

\0 Null character (e.g., "\0"is the null character)

\### Octal number (0-7) (e.g., "033"is the escape character)

\x## Hex number (0-F) (e.g., "x1B"is the escape character)

\u#### Unicode number (0-F) (e.g., "u001B"is escape character)

 

Note that these escape sequences cannot be used within strings enclosed by back quotes, which are explained below.

 


Single quote