Within a string or character literal these sequences can be used to insert special characters. They are all prefixed with a backslash.
ASCII 7; causes an alert/bell but does not change the output position.
1 | '\a'
|
ASCII 8; moves the output position left.
1 | '\b'
|
ASCII 12; moves the output position to the start of the next page.
1 | '\f'
|
ASCII 10; moves the output position to the start of the next line.
1 | '\n'
|
ASCII 13; moves the output position to the start of the current line.
1 | '\r'
|
ASCII 11; moves the output position to the next vertical tab.
1 | '\v'
|
ASCII 9; moves the output position to the next horizontal tab.
1 | '\t'
|
ASCII 39; outputs a single quote.
1 | '\''
|
ASCII 34; outputs a double quote.
1 | '\"'
|
ASCII 63; outputs a question mark.
1 | '\?'
|
ASCII 92; outputs a backslash.
1 | '\\'
|
Outputs the character given by the octal digits. There may be up to 3 digits.
1 | '\nnn' |
Outputs the character given by the 2 hexadecimal digits.
1 | '\xhh' |
Outputs the character given by the 4 hexadecimal digits.
1 | '\uhhhh' |
Outputs the character given by the 8 hexadecimal digits.
1 | '\Uhhhhhhhh' |