string

Represents an immutable string

Methods

endsWith(string substring) returns true if the string ends with the given substring
find(string substring, integer index) returns the first index of the given substring, starting from parameter index if given
find(regex expr, integer index) returns the first index of the given regular expression, starting from parameter index if given
len() returns the length of the string
ltrim() returns a copy of the string with whitespace removed from the start
matches(string pattern) returns true if the entire string matches the pattern
matches(regex pattern) returns true if the entire string matches the regular expression pattern
replace(string pattern, string replace, bool global) returns a new string with the given string pattern replaced by the given replacement string
replace(regex pattern, string replace, bool global) returns a new string with the regular expression pattern replaced by the given replacement string
rtrim() returns a copy of the string with whitespace removed from the end
slice(integer start, integer end) returns a substring as a new string
split(integer delimiter) splits the string into multiple using a character delimiter
split(string delimiter) splits the string into multiple using a string delimiter
split(regex delimiter) splits the string into multiple using a regular expression delimiter
startsWith(string substring) returns true if the string starts with the given substring
tofloat() returns the value as a float
tointeger() returns the value as an integer
tolower() returns a copy of the string converted to lower case
toupper() returns a copy of the string converted to upper case
trim() returns a copy of the string with whitespace removed from both ends

Method Documentation


bool endsWith(string substring)

Returns true if the string ends with the given substring

Parameters

Returns


integer find(string substring, integer index)

Returns the first index of the given substring, starting from parameter index if given

Parameters

Returns


integer find(regex expr, integer index)

Returns the first index of the given regular expression, starting from parameter index if given

Parameters

Returns


integer len()

Returns the length of the string

Returns


string ltrim()

Returns a copy of the string with whitespace removed from the start

Returns


bool matches(string pattern)

Returns true if the entire string matches the pattern

Parameters

Returns


bool matches(regex pattern)

Returns true if the entire string matches the regular expression pattern

Parameters

Returns


string replace(string pattern, string replace, bool global)

Returns a new string with the given string pattern replaced by the given replacement string

Parameters

Returns


string replace(regex pattern, string replace, bool global)

Returns a new string with the regular expression pattern replaced by the given replacement string

Parameters

Returns


string rtrim()

Returns a copy of the string with whitespace removed from the end

Returns


string slice(integer start, integer end)

Returns a substring as a new string

Parameters

Returns


array split(integer delimiter)

Splits the string into multiple using a character delimiter

Parameters

Returns


array split(string delimiter)

Splits the string into multiple using a string delimiter

Parameters

Returns


array split(regex delimiter)

Splits the string into multiple using a regular expression delimiter

Parameters

Returns


integer startsWith(string substring)

Returns true if the string starts with the given substring

Parameters

Returns


float tofloat()

Returns the value as a float

Returns


integer tointeger()

Returns the value as an integer

Returns


bool tolower()

Returns a copy of the string converted to lower case

Returns


string toupper()

Returns a copy of the string converted to upper case

Returns


string trim()

Returns a copy of the string with whitespace removed from both ends

Returns



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.