String Functions

Name(parameters) Parameter Domain Description Example

substring(string, start position, length?)

string, number1

return length (or all) characters in string, starting at start position. 1st position is 1, last position is -1

  • substring("redwood",3) = "dwood"

  • substring("redwood",3,3) = "dwo"

  • substring("redwood", -2, 1) = "o"

string length(string)

string

return length of string

string length("red") = 3

upper case(string)

string

return uppercased string

upper case("aBc4") = "ABC4"

lower case(string)

string

return lowercased string

lower case("aBc4") = "abc4"

substring before (string, match)

string, string

return substring of string before the match in string

  • substring before("redwood", "wood") = "red"

  • substring before("redwood", "xyz") = ""

substring after (string, match)

string, string

return substring of string after the match in string

  • substring after("redwood", "dw") = "ood"

  • substring after("", "o") = ""

replace(input, pattern, replacement, flags?)

string2

regular expression pattern matching and replacement

replace("abcd", "(ab)|(a)", "[1=$1][2=$2]") = "[1=ab] [2=]cd"

contains(string, match)

string

does the string contain the match?

contains("redwood", "de") = false

starts with(string, match)

string

does the string start with the match?

starts with("redwood", "re") = true

ends with(string, match)

string

does the string end with the match?

ends with("redwood", "d") = true

matches(input, pattern, flags?)

string2

does the input match the regexp pattern?

matches("redwood", "^re*w") = true