Skip to main content

When to use these helpers

Use these helpers to clean, format, search, split, and safely present text. Keep identifiers stable; do not use a display transformation as a substitute for a stored business value.

Calling style

Call a helper as trim($.request_reference). Not every helper is available everywhere: validation, form, and document-template helpers have distinct context contracts. Editor suggestions are not proof that a helper is supported at runtime.

Complete function reference

camelCase

Converts a string to camel case Signature: camelCase(str) Example:
Note: It can also be written as a transform when the first value is the input: value | camelCase(...).

capitalize

Capitalizes the first letter of a string Signature: capitalize(str) Example:
Note: It can also be written as a transform when the first value is the input: value | capitalize(...).

charCount

Counts the number of characters in a string Signature: charCount(str) Example:
Note: It can also be written as a transform when the first value is the input: value | charCount(...).

count

Counts occurrences of a substring in a string Signature: count(str, search) Example:
Note: It can also be written as a transform when the first value is the input: value | count(...).

countRegex

Counts occurrences of a regex in a string Signature: countRegex(str, regex, flags?) Example:
Note: It can also be written as a transform when the first value is the input: value | countRegex(...).

endsWith

Checks if a string ends with a specified substring Signature: endsWith(str, substring) Example:
Note: It can also be written as a transform when the first value is the input: value | endsWith(...).

escapeHtml

Escapes HTML special characters in a string Signature: escapeHtml(str) Example:
Note: It can also be written as a transform when the first value is the input: value | escapeHtml(...).

initials

Extracts the initials from a string Signature: initials(str) Example:
Note: It can also be written as a transform when the first value is the input: value | initials(...).

kebabCase

Converts a string to kebab case Signature: kebabCase(str) Example:
Note: It can also be written as a transform when the first value is the input: value | kebabCase(...).

lines

Splits a string into an array of lines Signature: lines(str) Example:
Note: It can also be written as a transform when the first value is the input: value | lines(...).

lower

Converts a string to lowercase Signature: lower(str) Example:
Note: It can also be written as a transform when the first value is the input: value | lower(...).

mask

Masks a string by replacing characters with a specified character Signature: mask(str, maskChar, start, end) Example:
Note: It can also be written as a transform when the first value is the input: value | mask(...).

matchRegex

Returns all matches of a regex against the string Signature: matchRegex(str, regex, flags?) Example:
Note: It can also be written as a transform when the first value is the input: value | matchRegex(...).

normalizeSpace

Removes duplicate consecutive whitespace characters. Signature: normalizeSpace(str) Example:
Note: It can also be written as a transform when the first value is the input: value | normalizeSpace(...).

pad

Pads a string to a specified length with another string Signature: pad(str, targetLength, padString?) Example:
Note: It can also be written as a transform when the first value is the input: value | pad(...).

padEnd

Pads a string from the end with another string Signature: padEnd(str, targetLength, padString?) Example:
Note: It can also be written as a transform when the first value is the input: value | padEnd(...).

padStart

Pads a string from the start with another string Signature: padStart(str, targetLength, padString?) Example:
Note: It can also be written as a transform when the first value is the input: value | padStart(...).

pascalCase

Converts a string to Pascal case Signature: pascalCase(str) Example:
Note: It can also be written as a transform when the first value is the input: value | pascalCase(...).

repeat

Repeats a string a specified number of times Signature: repeat(str, count) Example:
Note: It can also be written as a transform when the first value is the input: value | repeat(...).

replace

Replaces the first occurrence of a substring with another string Signature: replace(str, oldStr, newStr) Example:
Note: It can also be written as a transform when the first value is the input: value | replace(...).

replaceAll

Replaces all occurrences of a substring with another string Signature: replaceAll(str, oldStr, newStr) Example:
Note: It can also be written as a transform when the first value is the input: value | replaceAll(...).

replaceLast

Replaces the last occurrence of a substring with another string Signature: replaceLast(str, search, replace) Example:
Note: It can also be written as a transform when the first value is the input: value | replaceLast(...).

replaceRegex

Replaces substrings matched by a regex pattern with a replacement string Signature: replaceRegex(str, regex, replace, flags?) Example:
Note: It can also be written as a transform when the first value is the input: value | replaceRegex(...).

slug

Converts a string to a URL-friendly slug Signature: slug(str) Example:
Note: It can also be written as a transform when the first value is the input: value | slug(...).

snakeCase

Converts a string to snake case Signature: snakeCase(str) Example:
Note: It can also be written as a transform when the first value is the input: value | snakeCase(...).

split

Splits a string into an array of substrings Signature: split(str, separator) Example:
Note: It can also be written as a transform when the first value is the input: value | split(...).

startsWith

Checks if a string starts with a specified substring Signature: startsWith(str, substring) Example:
Note: It can also be written as a transform when the first value is the input: value | startsWith(...).

substr

Extracts a substring from a string Signature: substr(str, start, end?) Example:
Note: It can also be written as a transform when the first value is the input: value | substr(...).

titleCase

Converts a string to title case Signature: titleCase(str) Example:
Note: It can also be written as a transform when the first value is the input: value | titleCase(...).

trim

Removes whitespace from both ends of a string Signature: trim(str) Example:
Note: It can also be written as a transform when the first value is the input: value | trim(...).

trimEnd

Removes whitespace from the end of a string Signature: trimEnd(str) Example:
Note: It can also be written as a transform when the first value is the input: value | trimEnd(...).

trimStart

Removes whitespace from the start of a string Signature: trimStart(str) Example:
Note: It can also be written as a transform when the first value is the input: value | trimStart(...).

truncate

Truncates a string to a specified length Signature: truncate(str, length) Example:
Note: It can also be written as a transform when the first value is the input: value | truncate(...).

unescapeHtml

Unescapes HTML special characters in a string Signature: unescapeHtml(str) Example:
Note: It can also be written as a transform when the first value is the input: value | unescapeHtml(...).

upper

Converts a string to uppercase Signature: upper(str) Example:
Note: It can also be written as a transform when the first value is the input: value | upper(...).

wordCount

Counts the number of words in a string Signature: wordCount(str) Example:
Note: It can also be written as a transform when the first value is the input: value | wordCount(...).

Before you publish

  • Start with a known value and confirm the expected result.
  • Handle null, empty text, and empty lists deliberately.
  • Do not place secrets, access tokens, or sensitive personal data in an expression.
  • Read expression contexts and availability before copying an expression between features.
String helpers in KayanOS