Escape Sequences for Non-Printable ASCII Characters
This section describes escape sequences for non-printable ASCII characters in 'string' literals.
The following escape sequences need to be supported to allow us
to enter non-printable characters in string literals:
- If \ is followed by n ("\n"), the escape sequence represents the new-line character.
- If \ is followed by r ("\r"), the escape sequence represents the carriage-return character.
- If \ is followed by t ("\t"), the escape sequence represents the tab character.
- If \ is followed by x.., where .. are 2 hexadecimal digits,
the escape sequence represents the ASCII character defined by the byte value of the
2 hexadecimal digits.
For example, "\x07" represents the character that generates a beep on terminals.
Both upper case and lower case of hexadecimal digits are supported.
Examples of "string" literals with escape sequences for non-printable ASCII characters:
write("Leave a message after the beep: \x07.");
write("Backspace key to remove letter A\x08.");
write("What is the null character \x00 for?");
write("\x0a is the same as \n.");
write("\x0A is the same as \n.");
Table of Contents
About This Book
Introduction of H Language
"boolean" Data Type
"integer" Data Type
►"string" Data Type
What Is "string" Data Type
Escape Sequences in "string" Literals
►Escape Sequences for Non-Printable ASCII Characters
Escape Sequences for Unicode Characters
String Literals with Line Breaks
String Literals Continuing on Next Lines
Expression Interpolation in String Literals
String Literals with No Escape Sequences
Constructor Function: string()
string.get() - Retrieve Character from String
x[i] - Array Element Format for string.get()
string.set() - Update Character to String
x[i] - Array Element Format for string.set()
"string" "add" Operation
"string" "subtraction" Operation
"string" "multiplication" Operation
"string" "division" Operation
"string" "modulo" Operation
"real" Data Type
"array" Data Type
Source Code Packages
Classes and Objects
Object Oriented Programming
Inheritance - Object Attachments
Encapsulation - Private Members
Full Version in PDF/ePUB