name(arg1, arg2) syntax and can appear anywhere an expression is valid.
String functions
| Function | Description |
|---|---|
upper(s) | Convert string to uppercase |
lower(s) | Convert string to lowercase |
trimspace(s) | Strip leading and trailing whitespace |
trim(s, chars) | Strip specified characters from both ends |
trimprefix(s, prefix) | Remove prefix if present |
trimsuffix(s, suffix) | Remove suffix if present |
replace(s, old, new) | Replace all occurrences of old with new |
split(sep, s) | Split string into a list on separator |
join(sep, list) | Join list of strings with separator |
contains(s, substr) | True if string contains substring |
startswith(s, prefix) | True if string starts with prefix |
endswith(s, suffix) | True if string ends with suffix |
format(fmt, args...) | Printf-style string formatting |
substr(s, offset, length) | Extract substring |
Collection functions
| Function | Description |
|---|---|
len(coll) | Number of elements in a list, map, or string |
keys(m) | List of map keys |
values(m) | List of map values |
flatten(lists) | Flatten a list of lists into one list |
distinct(list) | Remove duplicate values |
sort(list) | Sort list of strings or numbers |
reverse(list) | Reverse a list |
concat(a, b) | Concatenate two lists |
slice(list, start, end) | Extract a sublist |
lookup(map, key, default) | Look up map key with fallback |
merge(a, b) | Merge two maps (b wins on collision) |
zipmap(keys, values) | Create a map from parallel key/value lists |
toset(list) | Convert list to set (deduplicate) |
tolist(set) | Convert set to sorted list |
Encoding functions
| Function | Description |
|---|---|
jsonencode(value) | Encode value as JSON string |
jsondecode(s) | Decode JSON string to value |
base64encode(s) | Base64-encode a string |
base64decode(s) | Decode a base64 string |
urlencode(s) | URL-encode a string |
Numeric functions
| Function | Description |
|---|---|
min(a, b) | Minimum of two numbers |
max(a, b) | Maximum of two numbers |
abs(n) | Absolute value |
ceil(n) | Round up |
floor(n) | Round down |
pow(base, exp) | Exponentiation |
Type conversion functions
| Function | Description |
|---|---|
tostring(v) | Convert value to string |
tonumber(s) | Parse string as number |
tobool(s) | Parse string as boolean |
Conditional / null helpers
| Function | Description |
|---|---|
coalesce(vals...) | Return first non-null value |
can(expr) | Return true if expression evaluates without error |

