H (Hybrid) Language - v0.03, by Dr. Herong Yang
String Literals with No Escape Sequences
This section describes string literals with no escape sequences.
Using escape sequences in a string literals allows us to make string literals smart. But escape sequences also require extra effort for us to enter strings that have double quotes or backward slashes. For example, here is a string of a Java command to display the version information on a Windows system:
# a command string on a Windows system cmd = "\"C:\\Program Files (x86)\\Java\\jre6\\BIN\\java.exe\" -version";
To avoid extra effort on coding escape sequences, H language will support a second format to enter string literals using single-quotes with 2 simple rules:
Examples of "string" literals using single-quotes:
''; 'A'; '"C:\Program Files (x86)\Java\jre6\BIN\java.exe" -version'; 'Who''s There?';
Table of Contents
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" "subtraction" Operation
"string" "multiplication" Operation
Inheritance - Object Attachments