Special ASCII characters
Description
You can include special ASCII characters in strings. For example,
you might want to include a tab in a string to ensure proper spacing
or a bullet to indicate a list item. The tilde character (~) introduces
special characters. The tab is one of
the common ASCII characters that can be entered by typing a tilde
followed by a single keystroke. The bullet must be entered by typing
a tilde followed by the decimal, hexadecimal, or octal ASCII value
that represents it.
Syntax
Follow the guidelines in the following table.
In this category |
To specify this |
Enter this |
More information |
---|---|---|---|
Common ASCII characters |
Newline |
~n |
|
Tab |
~t |
||
Vertical tab |
~v |
||
Carriage return |
~r |
||
Form feed |
~f |
||
Backspace |
~b |
||
Double quote |
~ |
||
Single quote |
~ |
||
Tilde |
~~ |
||
Any ASCII character |
Decimal |
~### |
### = a |
Hexadecimal |
~h## |
## = a 2-digit |
|
Octal |
~o### |
### = a |
Examples
Entering ASCII characters
Here is how to use special characters in strings:
String |
Description |
---|---|
“dog~n” |
A string containing the word dog followed |
“dog~tcat~ttiger” |
A string containing the word dog, |
Using decimal, hexadecimal, and octal values
Here is how to indicate a bullet (*) in a string
by using the decimal, hexadecimal, and octal ASCII values:
Value |
Description |
---|---|
“~249” |
The ASCII character with decimal value |
“~hF9” |
The ASCII character with hexadecimal |
“~o371” |
The ASCII character with octal value |