Working with strings
Last updated: Feb 11, 2025
There are a number of operations available for strings.
- Converting a string to uppercase or
lowercase—
.uppertolower(CHAR)
- Removing specified characters, such as
or`ID_`
, from a string variable—`$`
.stripchar(CHAR,STRING)
- Determining the length (number of characters) for a string
variable—
length(STRING).
- Checking the alphabetical ordering of string
values—
.alphabefore(STRING1, STRING2)
- Removing leading or trailing white space from
values—
,trim(STRING)
, ortrim_start(STRING)
.trimend(STRING)
- Extract the first or last n characters from a
string—
orstartstring(LENGTH, STRING)
. For example, suppose you have a field named item that combines a product name with a four-digit ID code (endstring(LENGTH, STRING)
). To create a new field that contains only the four-digit code, specify the following formula in a Derive node:ACME CAMERA-D109
endstring(4, item)
- Matching a specific pattern—
. For example, to select persons with "market" anywhere in their job title, you could specify the following in a Select node:STRING matches PATTERN
job_title matches "*market*"
- Replacing all instances of a substring within a
string—
. For example, to replace all instances of an unsupported character, such as a vertical pipe (replace(SUBSTRING, NEWSUBSTRING, STRING)
), with a semicolon prior to text mining, use the|
function in a Filler node. Under Fill in fields in the node properties, select all fields where the character may occur. For the Replace condition, select Always, and specify the following condition under Replace with.replace
replace('|',';',@FIELD)
- Deriving a flag field based on the presence of a specific substring. For example, you could use a string function in a Derive node to generate a separate flag field for each response with an expression such as:
hassubstring(museums,"museum_of_design")
See String functions for more information.
Was the topic helpful?
0/1000