XenoGuard 4.0 Documentation
Pad Left
ActionStep Reference » Programming » String Operation » Addendum » Pad Left
The ActionStep Pad Left inserts a character from the left of a specified string based on a specified total length and stores the new string in Result of the result list.
[-] Hide
- Open the Programming node in the Workspace Explorer.
- Open the String Operation node.
- In the Addendum node, select the Pad Left ActionStep.
Parameters:
The ActionStep has the following input parameters:
NAME |
DESCRIPTION
|
---|---|
String |
The string to be padded from the left.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Pad Char
|
A character to be inserted from the left.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Total Length
|
The number of characters to be inserted from the left including the length of the String parameter.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
Result |
Contains the new string.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter] |
![]() |
An exception occurs when the value of the Total Length parameter is a negative number or the Pad Char is empty.
|
![]() |
The Result will return the original string value if the Total Length parameter is less than or equal to the length of the String parameter. |
Example 1 (Adds five leading zeros to a variable):
This example inserts five leading zeros to the string of the local Invoice Number variable with Text as data type. The result of the new string is then output via Write Text.
![](../Storage/xenoguard-4-0-documentation/Actions/Programming/String%20Operations/Pad%20Left%20Example%20-%20Invoice.png)