String Functions

String Functions

joinStrings

available since: 1.0.0

joinStrings joins its argument strings putting separator in between each element, yielding a single string.

struct {}string

Example:

Query:
e.joinStrings({
  • separator: d.string(","),
  • strings: e.data(d.list(d.string("foo"), d.string("bar"), d.string("baz"))),
}
)
Result:
"foo,bar,baz"

stringToLower

available since: 1.0.0

Takes an UTF-8 string and converts it to lower case, following unicode rules.

Example:

Query:
e.stringToLower(d.string("CAPSÜÄÖË"))
Result:
"capsüäöë"

stringContains

available since: 1.0.0

Returns a boolean determining if a specified value is found in a string.

Example:

Query:
e.stringContains(d.string("foobar"), d.string("oba"))
Result:
true

matchRegex

available since: 1.0.0

Runs a regular expression against a string and reports whether there was a match.

struct {}T

Example:

Query:
e.matchRegex({
  • regex: "[0-9]{3}",
  • value: d.string("123"),
  • caseInsensitive: true,
  • multiLine: false,
}
)
Result:
true

searchAllRegex

available since: 1.0.0

Runs a regular expression against a string and returns a list of the offsets of all matches.

struct {}listint64

Example:

Query:
e.searchAllRegex({
  • regex: "[0-9]{3}",
  • value: d.string("123 qwer 456 asdf 789"),
  • caseInsensitive: true,
  • multiLine: false,
}
)
Result:
[ 0, 9, 18 ]

searchRegex

available since: 1.0.0

Runs a regular expression against a string and returns the offset of the first match or -1 if there was none.

struct {}int64

Example:

Query:
e.searchRegex({
  • regex: "[0-9]{3}",
  • value: d.string("qwer456asdf789"),
  • caseInsensitive: true,
  • multiLine: false,
}
)
Result:
4

substringIndex

available since: 1.0.0

Returns the index of the first occurrence of a specified value in a string, returns -1 if the searched value never occurs.

Example:

Query:
e.substringIndex(d.string("foobar"), d.string("oba"))
Result:
2