Split String at
Delimeter
The Split String at Delimeter action is
used to break up a string into an array of strings, or
tokens, based on the existence of a delimiter within the
string. An example use of this action would be to parse a
comma delimited string into an array of strings.
The Split String at Delimeter action is part of the Technology Preview Extension
This action is part of the Technology Preview
Extension, which is also referred to as the sandbox
package. The action will be found in the
String trigger action category
upon successful deployment of the sandbox
package,
See Technology
Preview Extension for information on obtaining
and installing the extension.
Parameters
Parameter | Description |
---|---|
Maximum Tokens | The maximum number of smaller strings, or tokens, to create. |
Token Length | The maximum length that can be allocated to each token. |
Input tab
Parameter | Description |
---|---|
String | The string value to be parsed into smaller strings. |
Delimeters | The string that contains the delimiter value. |
Output tab
Parameter | Description |
---|---|
Tokens | A string array that will hold the smaller strings parsed from the input string. The length of each string is defined by the Token Length parameter. The size of the array is determined by the Maximum Tokens parameter. |
Tokens Count | The actual number of smaller strings that were created upon completion of the action. This value can be less than or equal to the value defined in the Maximum Tokens parameter. |
For example:
- Given the String "Red,Green,Blue,Yellow,Purple,Orange", the Delimiters "," (comma), a Maximum Tokens value of 4, and an Token Length of 3, the action will return the values: "Red", "Gre", "Blu", and "Yel" in the Output parameter Tokens and a value of 4 in the Tokens Count parameter.
- Using the action again with the same parameters, except with a Delimiters value of "." (period), the action will return the value of "Red" and a value of 1 in the Tokens Count parameter. Only 1 token was created because the "." Delimiters value was not found in the string. The first three characters of the String value were used because the Token Length value was set to 3.
- Using the action a third time with the same parameters, except with a Delimiters value of "e" returns 4 values in the Tokens variable: "R", "d,Gr", "n,Blu", ",Y". The Tokens Count variable will contain a value of 4.