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.
Follow the guidelines in the following table.
Entering ASCII characters Here is how to use special characters in strings:
String |
Description |
---|---|
"dog~n" |
A string containing the word dog followed by a newline character |
"dog~tcat~ttiger" |
A string containing the word dog, a tab character, the word cat, another tab character, and the word tiger |
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 249 |
"~hF9" |
The ASCII character with hexadecimal value F9 |
"~o371" |
The ASCII character with octal value 371 |
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |