Version 0.55.1

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 added to string constants either as physical line breaks or as the literal sequence "/n".

The unicode character set is supported.

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

bool
int
float
file

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.

int char_code( int n )

Return the unicode value of the character at the nth position of the string.

Optional Open Parameter Attributes

bool readonly

Tells the user interface or frontend to disable the setting of the open parameter.

string style

Specifies some limited styling instructions for the user interface or frontend.

int maxlen

Defines a maximum number of characters of the string. This is enforced by the system.

See also

🗙

Search results for