Skip to main content
Version: 2.19.X

String Functions

String functions provide mechanisms for creating, transforming, and working with strings.

The examples for each function use the following notation:

  • Square brackets ([]) indicate arrays.
  • Curly braces ({}) indicate groups.
  • Arrows (==>) separate inputs and outputs. Inputs are shown on the left side of the arrow. Outputs are shown on the right side of the arrow.

Join

The Join function returns a string containing all input elements joined together by the specified delimiter.

Usage Information

CategoryDetails
Number of Arguments1+
Mandatory Argument Names and Datatypesarg: Any datatype.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and Datatypesdelimiter: The string to use as the delimiter. (By default, it joins the elements with no space between them.)
Modifiersignore null (default: True): If True, null values are not included in the output string. If False, null values are included as part of the output string.
Output Datatype(s)String
note

All input data must share the same datatype.

Join takes any of the following:

  • One or more sets of supported types.
  • One array.
  • Two or more scalar.
  • A mix of two or more scalars and sets.
  • A mix of one array and one or more scalar.

Examples

join(1,2,3, delimiter="|") ==> "1|2|3"
join(1,2,null,4, ignoreNull=True) ==> "124"
join(1,2,null,4, ignoreNull=False) ==> null

join([1,2,3]) ==> "123"

join({1,2,3}, delimiter=",") ==> "1,2,3"
join(1,{2,3,4}, delimiter=',') ==> {"1,2","1,3","1,4"}
join({1,2,3},{4,5,6}, delimiter="|") ==> {"1|4","2|5","3|6"}

join({[1,2,3],[4,5,6]}, delimiter=",") ==> "[1,2,3],[4,5,6]"

Left

The Left function returns the specified number of characters from the left of the entered string.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: A string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and Datatypesnum char (Default: 1): An integer indicating the length of the string.
ModifiersN/A
Output Datatype(s)String
note

The length of the string is determined by the num char value.

If the value of the arg integer exceeds the length of the string, then Left returns the complete string.

Examples

left("ABCDEFG",num_char=3) ==> "ABC"

left(["ABCDEFG","1234567","!@#$%^&"],num_char=3) ==> ["ABC","123","!@#"]

left({"ABCDEFG","1234567","!@#$%^&"},num_char=3) ==> {"ABC","123","!@#"}
left({"ABCDEFG","1234567","!@#$%^&"},num_char={1,2,3}) ==> {"A","12","!@#"}

left({["ABCDEFG","1234567","!@#$%^&"],["ABCDEFG","1234567","!@#$%^&"],["ABCDEFG","1234567","!@#$%^&"]},num_char=3) ==> {["ABC","123","!@#"],["ABC","123","!@#"],["ABC","123","!@#"]}

Length

The Length function returns the total number of characters in the specified string.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: A string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)Integer

Examples

length("ABCDEFG") ==> 7
length(["ABCDE","1234567","!@#$%^"]) ==> [5,7,6]
length({"ABCDE","1234567","!@#$%^"}) ==> {5,7,6}

length({["ABCDE","1234567","!@#$%^"],["ABCDE","1234567","!@#$%^"],["ABCDE","1234567","!@#$%^"]}) ==> {[5,7,6],[5,7,6],[5,7,6]}

Lower

The Lower function returns a string where all the characters from the input string are converted to lowercase.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: A string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)String

Examples

lower("ABCDEFG") ==> "abcdefg"
lower(["ABC","DEF","GHI"]) ==> ["abc","def","ghi"]
lower({"ABC","DEF","GHI"}) ==> {"abc","def","ghi"}
lower({["ABC","DEF","GHI"],["ABC","DEF","GHI"],["ABC","DEF","GHI"]}) ==> {["abc","def","ghi"],["abc","def","ghi"],["abc","def","ghi"]}

Replace All

The Replace All function returns a string where all occurrences of a given regular expression (regex) in the input string are replaced with the specified replacement string.

Usage Information

CategoryDetails
Number of Arguments3
Mandatory Argument Names and Datatypes
  • arg: The input string.
  • replace: A string indicating what should be replaced.
  • with: A string indicating what should go in place of the replace string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)String

Examples

replaceAll("I love pickles!", replace="pickles", with="Cogynt") ==> "I love Cogynt!"
replaceAll("I love pickles!", replace=" ", with="-") ==> "I-love-pickles!"
replaceAll("I love pickles!", replace="food", with="salads") ==> "I love pickles!"

replaceAll(["I love pickles!","I love dogs!","I love cats!"],replace=" ", with="-") ==> ["I-love-pickles!","I-love-dogs","I-love-cats"]

replaceAll({"I love pickles!","I love dogs!","I love cats!"},replace=" ", with="-") ==> {"I-love-pickles!","I-love-dogs","I-love-cats"}
replaceAll({"I love pickles!","I love dogs!","I love cats!"},replace={" ","!","don't like"}, with={"-","...","like"}) ==> {"I-love-pickles!","I love dogs...","I love cats!"}

Replace First

The Replace First function returns a string where the first occurrence of a given regular expression (regex) in the input string is replaced with the specified replacement string.

Usage Information

CategoryDetails
Number of Arguments3
Mandatory Argument Names and Datatypes
  • arg: The input string.
  • replace: A string indicating what should be replaced.
  • with: A string indicating what should go in place of the replace string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)String

Examples

replaceFirst("I love pickles!", replace="pickles", with="Cogynt") ==> "I love Cogynt!"
replaceFirst("I love pickles!", replace=" ", with="-") ==> "I-love pickles!"
replaceFirst("I love pickles!", replace="food", with="salads") ==> "I love pickles!"

replaceFirst(["I love pickles!","I love dogs!","I love cats!"],replace=" ", with="-") ==> ["I-love pickles!","I-love dogs","I-love cats"]

replaceFirst({"I love pickles!","I love dogs!","I love cats!"},replace=" ", with="-") ==> {"I-love pickles!","I-love dogs","I-love cats"}
replaceFirst({"I love pickles!","I love dogs!","I love cats!"},replace={" ","!","don't like"}, with={"-","...","like"}) ==> {"I-love pickles!","I love dogs...","I love cats!"}

The Right function returns the specified number of characters from the right of the entered string.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: A string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and Datatypesnum char (Default: 1): An integer indicating the number of characters to return.
ModifiersN/A
Output Datatype(s)String
note

If the value of the num char integer exceeds the length of the string, then Right returns the complete string.

Examples

right("ABCDEFG", num_char=3) ==> "EFG"

right(["ABCDEFG","1234567","!@#$%^&"],num_char=3) ==> ["EFG","567","%^&"]

right({"ABCDEFG","1234567","!@#$%^&"},num_char=3) ==> {"EFG","567","%^&"}
right({"ABCDEFG","1234567","!@#$%^&"},num_char={1,2,3}) ==> {"G","67","%^&"}

right({["ABCDEFG","1234567","!@#$%^&"],["ABCDEFG","1234567","!@#$%^&"],["ABCDEFG","1234567","!@#$%^&"]},num_char=3) ==> {["EFG","567","%^&"],["EFG","567","%^&"],["EFG","567","%^&"]}

Split

The Split function splits the input string by the specified delimiter, and returns an array of characters or words from the input string.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypesarg: The input string.
  • Scalar Support: True
  • Array Support: False
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and Datatypesby (Default: ""): A string representing the delimiter by which the input string will be split. If no argument is specified, the input string will be split into all of its individual characters.
ModifiersN/A
Output Datatype(s)Array of strings

Examples

split("I am a bird.") ==> ['I','','a','m','','a','','b','i','r','d','.']
split("I am a bird.", by=" ") ==> ['I','am','a','bird.']

split("I am a bird.\nI can fly.", by="\n") ==> ["I am a bird.","I can fly."]
split("I am a bird.\rI can fly.", by="\r") ==> ["I am a bird.","I can fly."]

split("I am a bird.", by=",") ==> ["I am a bird."]

split("") ==> [""]

split(null) => null
split("I am a bird.", by=null) ==> null

split(|"I am a bird.", "I can fly.", "I have wings."|, by=" ") ==> |["I","am","a","bird."],["I","can","fly."],["I","have","wings."]|
split(|"I am a bird.", "I can fly.", "I have wings."|, by=|" ",null,"."|) ==> |["I","am","a","bird."],null,["I have wings"]|
note

Special escapable characters, such as \n for new line, \r for return, and \t for tab, can be used as a delimiter in the by argument.

Sub String

The Sub String function returns a substring from an input string, beginning with the submitted starting index and continuing to the specified length.

Usage Information

CategoryDetails
Number of Arguments2
Mandatory Argument Names and Datatypes
  • arg: The input string.
  • start_index: An integer indicating the position of the starting index in the input string.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: False
Optional Argument Names and Datatypeslength (Default: The end of the string.): An integer specifying the length of the substring to return. If null, the default value is used.
ModifiersN/A
Output Datatype(s)String

Examples

substring("ABCDEFG",start_index=2,length=3) ==> "CDE"

substring(["ABCDEFG","1234567","!@#$%^&"],start_index=2,length=3) ==> ["CDE","345","#$%"]

substring({"ABCDEFG","1234567","!@#$%^&"},start_index=2) ==> {"CDEFG","34567","#$%^&"}
substring({"ABCDEFG","1234567","!@#$%^&"},start_index={2,3,4},length={1,2,3}) ==> {"CDEFG","4567","%^&"}

Trim

The Trim function removes leading and trailing spaces from the submitted string and returns the resulting string.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: The string to trim.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)String

Examples

trim("  X\n  Y  \nZ  \t") ==> "X\n  Y  \nZ  \t"

trim([" X\n Y \nZ \t"," space at beginning","space at the end. "]) ==> ["", "space at beginning", "space at the end."]

trim({" X\n Y \nZ \t"," space at beginning","space at the end. "}) ==> {"", "space at beginning", "space at the end."}
trim({[],[],[]}) ==> {[],[],[]}

Upper

The Upper function returns a string where all characters from the input string are converted to uppercase.

Usage Information

CategoryDetails
Number of Arguments1
Mandatory Argument Names and Datatypesarg: The string to convert.
  • Scalar Support: True
  • Array Support: True
  • Group of Scalars Support: True
  • Group of Arrays Support: True
Optional Argument Names and DatatypesN/A
ModifiersN/A
Output Datatype(s)String

Examples

upper("abcdefg") ==> "ABCDEFG"
upper(["abc","def","ghi"]) ==> ["ABC","DEF","GHI"]
upper({"abc","def","ghi"}) ==> {"ABC","DEF","GHI"}
upper({["abc","def","ghi"],["abc","def","ghi"],["abc","def","ghi"]}) ==> {["ABC","DEF","GHI"],["ABC","DEF","GHI"],["ABC","DEF","GHI"]}