The following operations can be used to perform operations on strings.
Function | Description | Arguments | Example |
---|---|---|---|
concat
|
Joins several arguments into one string. Any data type can be used. Types other than string are converted to string before the function is applied. | At least two strings to concatenate. | Expression: concat("Hello ",
"World!")
Result: |
concatWith
|
Joins several arguments into one string, with a specific delimiter. Any data type can be used. Types other than string are converted to string before the function is applied. |
|
Expression: concatWith(", ", "Smith", "John")
Result: |
contains
|
Returns true if the first argument
contains the second argument. Any data type can be used. Types other than
string are converted to string before the function is applied. If the first
argument is in bytes, the second one should be in bytes or a hex string with
the prefix 0x or 0X . |
|
Expression: contains("1, 2, 3", 2)
Result: |
indexOf
|
Returns the index of the second argument if it appears in the first,
otherwise it returns -1 . The first index is
0 . Any data type can be used. Types other than string
are converted to string before the function is applied. If the first
argument is in bytes, the second one should be in bytes or a hex string with
the prefix 0x or 0X . |
|
Expression: indexOf("abcd", "d")
Result: |
left
|
Extracts a substring with a specific length from the first argument, starting with the left-most character. Any data type can be used for the first argument. Types other than string are converted to string before the function is applied. |
|
Expression: left("Hello World!", 5)
Result: |
length
|
Returns the length of the argument. Any data type can be used. For bytes, the byte length is returned. | Element for which you want to return the length. | Expression: length(0xFFFF)
Result: |
lowerCase
|
Converts all characters in a string to lower case. | Input string. | Expression: lowerCase("Hello World!")
Result: |
matches
|
Returns true if a regular expression matches an input
string. |
|
Expression: matches("Hello World!",
"\w+\s\w+!", true, true, 15)
Result: |
normalizeSpace
|
Removes excess leading or trailing whitespace. If there are multiple spaces between words, they are reduced to one space. Any whitespace non-blank characters are removed. | Input string. | Expression: normalizeSpace(" Hello World!
")
Result: |
replace
|
Replaces characters that match a regular expression with another string. |
|
Expression: replace("abc_123_456", "\d+",
"000", true, 15)
Result: |
right
|
Extracts a substring with a specific length from the first argument, starting with the right-most character. Any data type can be used for the first argument. Types other than string are converted to string before the function is applied. |
|
Expression: right("Hello World!",
6)
Result: |
startsWith
|
Returns true if the first argument starts with the
prefix specified in the second argument. Any data type can be used. Types
other than string are converted to string before the function is applied. If
the first argument is in bytes, the second one should be in bytes or a hex
string with the prefix 0x or 0X . |
|
Expression: startsWith("Hello World!",
"Hello")
Result: |
endsWith
|
Returns true if the first argument ends with the
suffix specified in the second argument. Any data type can be used. Types
other than string are converted to string before the function is applied. If
the first argument is in bytes, the second one should be in bytes or a hex
string with the prefix 0x or 0X . |
|
Expression: endsWith("Hello World!",
"!")
Result: |
subString
|
Returns a substring of characters starting at specific index. |
|
Expression: subString("Hello World!", 6,
5)
Result: |
translate
|
Replaces individual characters with other individual characters. |
|
Expression: translate("abcde", "ace",
"123")
Result: |
trim
|
Removes excess leading and trailing whitespace. | Input string. | Expression: trim(" Hello World! ")
Result: |
upperCase
|
Converts all characters in a string to upper case. | Input string. | Expression: upperCase("Hello
World!")
Result: |