string-functions.md

March 27, 2026 ยท View on GitHub

Scope

String filter functions available through the core query engine.

Source of truth: src/packages/core/src/query-engine/functions/string-functions.ts

Function List (20)

FunctionSignatureDescriptionExample
upperupper(value)Convert string to uppercase."hello" | upper -> "HELLO"
lowerlower(value)Convert string to lowercase."HELLO" | lower -> "hello"
capitalizecapitalize(value)Capitalize first character."hello" | capitalize -> "Hello"
trimtrim(value)Trim both ends." hi " | trim -> "hi"
ltrimltrim(value)Trim left side." hi" | ltrim -> "hi"
rtrimrtrim(value)Trim right side."hi " | rtrim -> "hi"
replacereplace(value, search, replacement)Replace all substring matches."a-b-a" | replace("a", "x") -> "x-b-x"
sliceslice(value, start, end?)Substring slice."hello" | slice(1, 4) -> "ell"
splitsplit(value, delimiter)Split string into array."a,b" | split(",") -> ["a", "b"]
joinjoin(arrayValue, separator)Join array into string.["a","b"] | join("-") -> "a-b"
startsWithstartsWith(value, prefix)Prefix check."hello" | startsWith("he") -> true
endsWithendsWith(value, suffix)Suffix check."hello" | endsWith("lo") -> true
includesincludes(value, substring)Contains check."hello" | includes("ell") -> true
indexOfindexOf(value, substring)Index lookup."hello" | indexOf("l") -> 2
padStartpadStart(value, length, fillStr?)Left pad to target length."7" | padStart(3, "0") -> "007"
padEndpadEnd(value, length, fillStr?)Right pad to target length."7" | padEnd(3, "0") -> "700"
repeatrepeat(value, count)Repeat string."ab" | repeat(2) -> "abab"
reversereverse(value)Reverse characters."abc" | reverse -> "cba"
escapeescape(value)HTML-escape text."<b>" | escape -> "&lt;b&gt;"
truncatetruncate(value, length, suffix?)Truncate with optional suffix."hello world" | truncate(5) -> "hello..."

Notes

  • replace uses a global regular expression built from search.
  • join expects an array input and throws on non-array values.
  • truncate appends ... by default when a suffix is not provided.