Left
The Left action, found under @Generic Element, extracts characters from the left side of a given string starting from position 1 up to the specified length. The extracted substring is stored in a dynamic variable, along with a status indicating whether the extraction was successful.
Syntax:
Input Value: <string>;<position to fetch the string from>
Output Value: <Dynamic Variable>;<Dynamic Variable>(Optional)
<string>
It is the sequence of characters from which a specific portion is fetched from the left side
<position to fetch the string from>
Provide the count of characters to extract from the left side of the given string. Count number must be a positive integer. Note: Index values start from the 1st position.
<Dynamic Variable>
This variable holds the extracted substring from left side.
<Dynamic Variable>(Optional)
This variable stores the operation status as True or False.
Output: Upon the usage of this action, here are the possible returns and their reason.
Output
Displays the substring extracted from the left side of the input string.
None/Blank
If the Input Value is missing.
True
If the substring was successfully extracted.
False
If the invalid position specified or input string is empty.
Examples:
Scenario 1: Extracting the first 3 characters from a string
Input Value:
"Automation;3"Output Value:
{Left Position} = "Aut"; {Status} = True
Scenario 2: Extracting the first 5 characters from a string
Input Value:
"Testing;5"Output Value:
{Left Position} = "Testi"; {Status} = True
Scenario 3: Invalid position greater than string length
Input Value:
"Data;10"Output Value:
{Left Position} = ""; {Status} = False
Scenario 4: Empty input string
Input Value:
";3"Output Value:
{Left Position} = ""; {Status} = False
Notes:
Positions are counted starting from 1 (leftmost character).
If the position exceeds the length of the string, the action will fail with status
False.Found under @Generic Element.
Last updated
Was this helpful?