H (Hybrid) Language - v0.03, by Dr. Herong Yang
Constructor Function: string()
This section describes 'string' constructor function string().
New "string" data object can be created with the "string" constructor function, string(), which has the following syntax:
string(a = "") Parameters: a - A "string" data object. Default is "". Return: Returns a new "string" data object representing the same value as "a".
Examples of how to use "string" constructor function:
string(); # create a new data object representing "" x = string(); # assign a new data object representing "" to x # assign a new data object to y y = string("Hello world!");
Design options:
1. Let the constructor return "" if no parameter provided.
2. Make the parameter as required for the constructor.
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