Package: string
String handling APIs.
Methods
coalesce
function coalesce(value1 as string, value2 as string) as string
Returns the first non-null value. value2 cannot be null.
Since 1.5.1
contains
function contains(target as string, search as string) as bool
Returns true if the target string contains the specified search string.
endsWith
function endsWith(target as string, search as string) as bool
Returns true if the target string ends with the specified search string.
fromDateTime
function fromDateTime(value as datetime) as string
Converts a datetime value to a string.
fromDecimal
function fromDecimal(value as decimal) as string
Converts a decimal value to a string.
indexOf
function indexOf(target as string, search as string) as int
Returns the index of the first occurrence of the search string in the target string. If not found, returns -1.
isBlank
function isBlank(value as string) as bool
Returns true if the value is null or contains only whitespaces.
Since 1.7.0
isDateTime
function isDateTime(value as string) as bool
Returns true if the given string is a valid datetime representation.
isDecimal
function isDecimal(value as string) as bool
Returns true if the given string is a valid decimal representation.
isInt
function isInt(value as string) as bool
Returns true if the given string is a valid integer representation.
length
function length(target as string) as int
Returns the length of the string.
replace
function replace(target as string, from as string, to as string) as string
Replaces all occurrences of from with to in the target string.
split
function split(target as string, splitter as string) as list of string
Splits the target string into a list of substrings using the specified splitter string.
startsWith
function startsWith(target as string, search as string) as bool
Returns true if the target string starts with the specified search string.
substring
function substring(target as string, start as int, end as int) as string
Returns the substring of the target string from the specified start index to end-1.
toLower
function toLower(target as string) as string
Converts the target string to lowercase.
toSentenceCase
function toSentenceCase(target as string) as string
Converts the first character of the target string to uppercase and the rest to lowercase.
toTitleCase
function toTitleCase(target as string) as string
Converts the first character of each word in the target string to uppercase.
toUpper
function toUpper(target as string) as string
Converts the target string to uppercase.
trim
function trim(target as string) as string
The trim method removes whitespace from both ends of a the target.