Return to homepage

DOSATO

Copyright © 2024 Sebastiaan Heins

3.2 Strings

Functions

string TO_STRING (val value)

Converts the given value to a string.
Exact same behaviour as a typecast to string.

array SPLIT (string value, string delimiter)

Splits a string into an array of strings, using the given delimiter.

string LOWER (string value)

Returns the given string in lowercase.

string UPPER (string value)

Returns the given string in uppercase.

long STRINGLENGTH (string value)

Returns the length of the given string.

string SUBSTRING (string value, long start, long end)

Returns a substring of the given string, starting at the given start index and ending at the given end index.

long STRINGINDEXOF (string value, string search, long start = 0)

Returns the index of the first occurence of the given search string in the given string, starting at the given start index.

long STRINGLASTINDEXOF (string value, string search, long start = 0)

Returns the index of the last occurence of the given search string in the given string, starting at the given start index.

bool STARTSWITH (string value, string str, long start = 0)

Returns true if the given string starts with the given substring, starting at the given start index.

bool ENDSWITH (string value, string str, long start = 0)

Returns true if the given string ends with the given substring, starting at the given start index.

string REPLACE (string value, string search, string replace, long start = 0)

Returns the given string with all occurences of the given search string replaced with the given replace string, starting at the given start index.

string TRIM (string value)

Returns the given string with all leading and trailing whitespace removed.

string STRINGREVERSE (string value)

Returns the given string in reverse.

bool STRINGCONTAINS (string value, string search, long start = 0)

Returns true if the given string contains the given search string, starting at the given start index.

string STRINGREMOVE (string value, long start, long end)

Returns the given string with the substring starting at the given start index and ending at the given end index removed.

string STRINGINSERT (string value, string insert, long index)

Returns the given string with the given insert string inserted at the given index.

long STRINGTOINT (string value)

Converts the given ascii string to an integer ("123" becomes 123).
If the string cannot be converted to an integer, 0 is returned.

double STRINGTODOUBLE (string value)

Converts the given ascii string to a double ("123.45" becomes 123.45).
If the string cannot be converted to a double, 0 is returned.

long STRINGCOUNT (string value, string search, long start = 0)

Returns the number of occurences of the given search string in the given string, starting at the given start index.

string JOIN (array character_array, string delimiter)

Joins an array of strings into a single string, using the given delimiter.