Substring
You can use Substring activity to return part of a string starting with the character in the Beginning Index and ending with the character in the specified End Index.
Index positions within the string are sequentially numbered starting with 0. For example:
- Source String - dictionary
- Beginning Index - 4
- End Index - 6
- Output - ion
If you enter only an End Index value, the output will return all characters from the beginning of the source string to the End Index. For the example above with an End Index of 6, the output would be diction.
If you enter only a Beginning Index, the output will return all characters from the Beginning Index to the end of the string. For the example above with a Beginning Index of 4, the output would be ionary.
Note: The Beginning Index value must be less than or equal to the End Index value. If the Beginning Index value is greater than that of the End Index, the activity will fail.
You can manually enter the Source String, Beginning Index, and End Index values or use variables such as the output from other workflow activities, sub-workflows, or atomic actions that occur earlier in the workflow.
Usage
Complete the following properties to use this activity:
- Substring - Enter the following information or click the Variable Reference icon to choose a variable.
- Source String - Enter the source string.
- Beginning Index - Enter the beginning index of the string to be returned.
- End Index - Enter the end index of the string to be returned.
After this activity completes, the new substring text will be located in the Output Substring field in the activity properties.