Trim

Removes all empty characters (whitespace) from either side of the specified string.

Syntax

Trim( StringValue );

Parameters

Parameter Name Type Description Optional? Default Value
StringValue String The string to trim. No n/a

Output

The updated string with all empty characters on either side removed.

Use Case

Depending on where you get the data from, strings can occasionally contain leftover spaces that you want to remove. This can be due to the way the collected data is formatted, or the way it is input by the end user. Either way, if you want to remove the excess whitespace, you would use an expression like the one below:

FirstName = Trim ( FirstName )

We assign the value of the function back to the original variable, discarding the original value by replacing it with the trimmed one. The value of FirstName changes from β€œ Tom ” to β€œTom”.