Skip to main content
Version: 2.15.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.

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","%^&"]}

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"]}