Skip to content

String Functions

String functions manipulate text values. All functions handle null input gracefully by treating it as an empty string.

upper

Converts a string to uppercase.

Signature: upper(value)

`{ {upper(row.name)}}`
// "john doe" → "JOHN DOE"

lower

Converts a string to lowercase.

Signature: lower(value)

`{ {lower(row.email)}}`
// "John@Example.COM" → "john@example.com"

trim

Removes leading and trailing whitespace.

Signature: trim(value)

`{ {trim(row.name)}}`
// "  John Doe  " → "John Doe"

strlen

Returns the length of a string in characters.

Signature: strlen(value)

`{ {strlen(row.description)}}`
// "Hello world" → 11

Useful in conditions:

strlen(row.bio) > 0

substr

Extracts a substring by position and optional length.

Signature: substr(value, start, length?)

ParameterTypeDescription
valuestringThe source string.
startnumberStarting position (0-based).
lengthnumberOptional. Number of characters to extract. Omit for "rest of string".
`{ {substr(row.title, 0, 50)}}`
// "A very long title that goes on..." → "A very long title that goes on and on and on and o"

`{ {substr(row.code, 2)}}`
// "AB1234" → "1234"

replace

Replaces all occurrences of a search string with a replacement.

Signature: replace(value, search, replacement)

`{ {replace(row.phone, '-', '')}}`
// "555-123-4567" → "5551234567"

`{ {replace(row.status, '_', ' ')}}`
// "in_progress" → "in progress"

contains

Checks if a string contains a substring. Returns true or false.

Signature: contains(value, needle)

`{ {contains(row.tags, 'featured') ? 'Featured' : ''}}`

// Use in conditions:
contains(row.email, '@company.com')

split

Splits a string into an array by a delimiter.

Signature: split(value, delimiter)

`{ {split(row.tags, ',')}}`
// "php,javascript,python" → ["php", "javascript", "python"]

Combine with other functions:

`{ {count(split(row.tags, ','))}}`
// "php,javascript,python" → 3

join

Joins an array into a string with a glue string.

Signature: join(array, glue?)

ParameterTypeDefaultDescription
arrayarray--The array to join.
gluestring", "The separator string.
`{ {join(row.tags, ', ')}}`
// ["php", "javascript", "python"] → "php, javascript, python"

`{ {join(row.names, ' & ')}}`
// ["Alice", "Bob"] → "Alice & Bob"

If the input is not an array, it is returned as a string.

Combining String Functions

String functions can be composed:

`{ {upper(substr(row.name, 0, 1)) ~ lower(substr(row.name, 1))}}`
// "jOHN" → "John"

`{ {trim(replace(row.address, '\n', ', '))}}`
// "123 Main St\nNew York" → "123 Main St, New York"

`{ {join(split(trim(row.tags), ','), ' | ')}}`
// " php,js,py " → "php | js | py"