The trim task is used to remove whitespace from both ends of a string (the beginning and the end).
Potential Use Case
If you want to make sure no spaces have been added at the beginning and end of your dataset in a string entry, then use the trim task to find and remove them.
Input and output parameters are shown below.
||string||Required. The string to remove whitespace from.|
||string||A new string representing the input
In this example, a New Job Variable named "String" is used to input the data into the trim task and the value is Hello World, with spaces at the beginning and the end of the string.
Next, the trim task is used to reference New Variable: String within the Reference task. The Reference variable is automatically set to accept the incoming
str value from the Reference task that is used as input.
After running the job, notice that the incoming variable has whitespace before and after the words Hello World (as shown by the placement of the quotation marks).
noWhitespace result that returns will be "Hello World" and the whitespace has been removed.