Get Sub String
Last updated
Was this helpful?
Last updated
Was this helpful?
The Get Sub String Action in the Avo Assure is found under the @Generic Element. This action in Avo Assure tells the client to extract a specific portion of a string based on a specified index or range, then it saves the result in an output variable.
Input: <string>;< index OR range>
String: It refers to a sequence of characters (letters, numbers, symbols) treated as text.
Index OR Range: The position from where user must get the string of actual output.
Note: For the above syntax if it declared as
Index: It will extract all the remaining string from specific declared index up to last index.
Range: A range that starts from the first character of the string and approaches the end will exclude the last item. To capture the required string, add an extra (total range+1) index to the range
Output: <Dynamic Variable>
Note: Input index should start from “0” till “n”
To fetch the input for Index value:
To fetch the input for Range value:
As in the above example have a system that generates usernames with a prefix and a number (e.g., “EMP114223”). Users want to test extracting the number part of the username for validation.
Username is “EMP114223”.
To fetch the extracted value, the following input is required.
1. EMP114223;3 (for index),
2.EMP114223;3-9 (for range)
The extracted value is “114223”, and it can now be validated (e.g., check if it has 6 digits)
The result of the substring is stored in the {result} output variable as 114223, which can be utilized for display or further use.