The padEnd task is used to pad the end of a string with another string (repeated, if needed) so that the resulting string reaches a specified length. The padding is applied from the right end of the given string.
Potential Use Case
Suppose you have a dataset of a known length and you would like to have that dataset repeated at the end of the current dataset. You could use the padEnd task to specify the numeric length and variables needed to "pad" or be added to the end of the original dataset.
Input and output parameters are shown below.
||String||Required. The string to pad.|
||Number||Required. The desired length of the resulting string once the string has been padded. If the value is less than the
||String||Required. The string to pad the original string with. If this value is too long to be within the
||String||A string of a specified length that has been padded at the end with a given string.|
In this IAP example:
strvariable has been set with the words "Hello World" and the current length of the string is 11 spaces or characters, but the new
targetLengthis set to 14.
padStringvariable to apply until the string reaches 14 characters in length is an exclamation mark ("!").
The expected end result will be "Hello World!!!", and the end of the word string for "Hello World" has been padded with three "!!!" exclamation marks in order to fulfill the specified