Skip to content

String Functions

Before going in note that any time VARNAME or FUNCNAME is written, it means a variable or function in the form Collection@Variable or a literal.

String Functions

tostring

Syntax:

VARNAME1 = tostring(VARNAME2)

Returns the string representation of VARNAME2 to VARNAME1. VARNAME2 can be a bool, str, or num to work, otherwise an error will be thrown.

chars

Syntax:

VARNAME1 = chars(VARNAME2)

Returns the array of characters in the string VARNAME2 to VARNAME1.

concat

Syntax:

VARNAME1 = concat(VARNAME2, VARNAME3)
Returns the concatenation of the two strings. If either of the arguments is not a string, it will be converted to a string before concatenation. Arrays and Lambda cannot be used as strings.

strlen

Syntax:

VARNAME1 = strlen(VARNAME2)
Returns the length of the string VARNAME2 to VARNAME1.

strslice

Syntax:

VARNAME1 = strslice(VARNAME2, VARNAME3, VARNAME4)

Returns a substring of VARNAME2 starting from index VARNAME3 and ending at index VARNAME4, and assigns the result to VARNAME1. The indices are zero based.

replace

Syntax:

VARNAME1 = replace(VARNAME2, VARNAME3, VARNAME4)

Returns a new string where the first occurrence of the substring VARNAME3 in VARNAME2 are replaced with VARNAME4, and assigns the result to VARNAME1. If VARNAME3 is not found in VARNAME2, the original string is returned unchanged.

replace_all

Syntax:

VARNAME1 = replace_all(VARNAME2, VARNAME3, VARNAME4)

Returns a new string where all occurrences of the substring VARNAME3 in VARNAME2 are replaced with VARNAME4, and assigns the result to VARNAME1. If VARNAME3 is not found in VARNAME2, the original string is returned unchanged.

trim

Syntax:

VARNAME1 = trim(VARNAME2)

Returns a new string with all leading and trailing whitespace removed from VARNAME2, and assigns the result to VARNAME1. Whitespace includes spaces, tabs, and newline characters.