string
A sequence of characters.
Details
Strings constants can be inserted into the code as text standing either inside single quote (') or double quote (") characters, e.g. "Lorem ipsum" or 'Lorem ipsum'.
Line breaks can be inserted into a string literal either via the newline character '\n' or by adding a line break directly.
Strings may contain unicode characters.
Example
string s = "lorem ipsum"
echo( s )
echo( s.length() )
echo( s.char( 3 ) )
Output
lorem ipsum
11
e
Casts To
Members
- int length()
-
Returns the length of the string as number of characters.
- string char( int n )
-
Returns a string containing the character at the nth position of the original string. The indices are zero-based: the first character is at position 0, the second in 1, and so on.