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

String Interpolation

Syntax:

"${VARNAME1}"

Used inside strings to include variables inside the string, the value of VARNAME1 will be formatted into the string instead of the placeholder

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.

split

Syntax:

VARNAME1 = split(VARNAME2, VARNAME3)

Splits the string VARNAME2 at each instance of VARNAME3, returning the array of results to VARNAME1

join

Syntax:

VARNAME1 = join(VARNAME2, VARNAME3)

Joins each element of the array VARNAME2 with seperator VARNAME3, with VARNAME1 being assigned the result

repeat

Syntax:

VARNAME1 = repeat(VARNAME2, VARNAME3)

Repeats the string VARNAME2, VARNAME3 times returning the result to VARNAME1

contains

Syntax:

VARNAME1 = contains(VARNAME2, VARNAME3)

Gets if VARNAME2 contains VARNAME3, returning as bool to VARNAME1

to_upper

Syntax:

VARNAME1 = to_upper(VARNAME2)

Returns VARNAME2 in all uppercase to VARNAME1