Strings
Function | Description | Meta |
---|---|---|
concat |
Joins a set or array of strings with a delimiter. Arguments: Returns:delimiter (string)string to use as a delimiter collection (any<array[string], set[string]>)strings to join output (string)the joined string | Wasm |
contains |
Returns Arguments: Returns:haystack (string)string to search in needle (string)substring to look for result (boolean)result of the containment check | Wasm |
endswith |
Returns true if the search string ends with the base string. Arguments: Returns:search (string)search string base (string)base string result (boolean)result of the suffix check | Wasm |
format_int |
Returns the string representation of the number in the given base after rounding it down to an integer value. Arguments: Returns:number (number)number to format base (number)base of number representation to use output (string)formatted number | Wasm |
indexof |
Returns the index of a substring contained inside a string. Arguments: Returns:haystack (string)string to search in needle (string)substring to look for output (number)index of first occurrence, | Wasm |
indexof_n |
Returns a list of all the indexes of a substring contained inside a string. Arguments: Returns:haystack (string)string to search in needle (string)substring to look for output (array[number])all indices at which | v0.37.0 SDK-dependent |
lower |
Returns the input string but with all characters in lower-case. Arguments: Returns:x (string)string that is converted to lower-case y (string)lower-case of x | Wasm |
replace |
Replace replaces all instances of a sub-string. Arguments: Returns:x (string)string being processed old (string)substring to replace new (string)string to replace y (string)string with replaced substrings | Wasm |
split |
Split returns an array containing elements of the input string split on a delimiter. Arguments: Returns:x (string)string that is split delimiter (string)delimiter used for splitting ys (array[string])split parts | Wasm |
sprintf |
Returns the given string, formatted. Arguments: Returns:format (string)string with formatting verbs values (array[any])arguments to format into formatting verbs output (string)
| SDK-dependent |
startswith |
Returns true if the search string begins with the base string. Arguments: Returns:search (string)search string base (string)base string result (boolean)result of the prefix check | Wasm |
strings.any_prefix_match |
Returns true if any of the search strings begins with any of the base strings. Arguments: Returns:search (any<string, array[string], set[string]>)search string(s) base (any<string, array[string], set[string]>)base string(s) result (boolean)result of the prefix check | v0.44.0 SDK-dependent |
strings.any_suffix_match |
Returns true if any of the search strings ends with any of the base strings. Arguments: Returns:search (any<string, array[string], set[string]>)search string(s) base (any<string, array[string], set[string]>)base string(s) result (boolean)result of the suffix check | v0.44.0 SDK-dependent |
strings.count |
Returns the number of non-overlapping instances of a substring in a string. Arguments: Returns:search (string)string to search in substring (string)substring to look for output (number)count of occurrences, | v0.67.0 SDK-dependent |
strings.render_template |
Renders a templated string with given template variables injected. For a given templated string and key/value mapping, values will be injected into the template where they are referenced by key. For examples of templating syntax, see https://pkg.go.dev/text/template Arguments: Returns:value (string)a templated string vars (object[string: any])a mapping of template variable keys to values result (string)rendered template with template variables injected | v0.59.0 SDK-dependent |
strings.replace_n |
Replaces a string from a list of old, new string pairs. Replacements are performed in the order they appear in the target string, without overlapping matches. The old string comparisons are done in argument order. Arguments: Returns:patterns (object[string: string])replacement pairs value (string)string to replace substring matches in output (string)string with replaced substrings | Wasm |
strings.reverse |
Reverses a given string. Arguments: Returns:x (string)string to reverse y (string)reversed string | v0.36.0 Wasm |
substring |
Returns the portion of a string for a given Arguments: Returns:value (string)string to extract substring from offset (number)offset, must be positive length (number)length of the substring starting from output (string)substring of | Wasm |
trim |
Returns Arguments: Returns:value (string)string to trim cutset (string)string of characters that are cut off output (string)string trimmed of | Wasm |
trim_left |
Returns Arguments: Returns:value (string)string to trim cutset (string)string of characters that are cut off on the left output (string)string left-trimmed of | Wasm |
trim_prefix |
Returns Arguments: Returns:value (string)string to trim prefix (string)prefix to cut off output (string)string with | Wasm |
trim_right |
Returns Arguments: Returns:value (string)string to trim cutset (string)string of characters that are cut off on the right output (string)string right-trimmed of | Wasm |
trim_space |
Return the given string with all leading and trailing white space removed. Arguments: Returns:value (string)string to trim output (string)string leading and trailing white space cut off | Wasm |
trim_suffix |
Returns Arguments: Returns:value (string)string to trim suffix (string)suffix to cut off output (string)string with | Wasm |
upper |
Returns the input string but with all characters in upper-case. Arguments: Returns:x (string)string that is converted to upper-case y (string)upper-case of x | Wasm |
When using sprintf
, values are pre-processed and may have an unexpected type. For example,
%T
evaluates to string
for both string
and boolean
types. In such cases, use type_name
to
accurately evaluate the underlying type.