Expression String Functions

On This Page

The following Boolean string-comparison functions are supported in expressions.
All functions receive two string parameters. Each parameter can be provided either as a constant literal string (LITERAL), or as an attribute variable (ATTRIBUTE) that represents a string attribute (of type "S") whose value will be used in the comparison.

ends

ends(s1, s2)

Checks whether the first string (s1) ends with the second string (s2).

For example, ends('4-Jun-2018', year) returns true for a year string attribute whose value is "2018".

contains

contains(s1, s2)

Checks whether the first string (s1) contains the second string (s2).

For example, contains(rainbow, 'yellow') returns true for a rainbow attribute whose value is "red, orange, yellow, green, blue, indigo, violet".

length

length(s)

Returns the length of the provided string (s) — i.e., the number of characters in the string.
s can also be an expression that evaluates to a string.

For example:

  • length("123") returns 3.
  • length(mystr) for a mystr attribute whose value is "Hello World!" returns 12.
  • length ('abc' + 'efg') returns 6.
Note
length is supported in update expressions.

starts

starts(s1, s2)

Checks whether the first string (s1) starts with the second string (s2).

For example, starts(fullName, 'Jo') returns true for a fullName attribute whose value is "Jon Snow".

See Also