- 10 Feb 2025
-
DarkLight
-
PDF
trimEnd
- Updated on 10 Feb 2025
-
DarkLight
-
PDF
Task Purpose
The trimEnd
task is used to remove whitespace at the end of a string. Whitespace can include spaces and tabs.
Potential Use Case
If you want to make sure that no spaces are left at the end of any datasets in a string entry, then you would use the trimEnd
task to find and remove them.
Properties
Input and output parameters are shown below.
Incoming | Type | Description |
---|---|---|
str |
String | Required. The string to remove whitespace from. |
Outgoing | Type | Description |
---|---|---|
trimmedEnd |
String | A new string stripped of whitespace from its (right) end. |
Example
In this example, a New Job Variable task is used to input the data into the trimEnd task. The New Variable Name is String
and the input Value is Hello World
, with spaces at the beginning and end of the words.
Next the trimEnd task is used to reference New Variable: String
within the Reference task. The Reference variable is automatically set to accept the value from the task being used as an input.
After running the job, notice that the incoming variable in Task History has spaces before and after the words Hello World
. This is notated by the placement of the quotations.
The outgoing variable that is produced will be "Hello World"
and the whitespace after the word World
has been removed.