trim
  • 23 May 2023
  • Dark
    Light
  • PDF

trim

  • Dark
    Light
  • PDF

Article summary

trim Task Purpose

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.

Properties

Input and output parameters are shown below.

Incoming Type Description
str string Required. The string to remove whitespace from.


Outgoing Type Description
noWhitespace string A new string representing the input str stripped of whitespace from both ends.

Example

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.

trimTask-01

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.

trimTask-02

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).

trimTask-03

The noWhitespace result that returns will be "Hello World" and the whitespace has been removed.

trimTask-04


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.