Trim
What is it?
The Trim function removes all empty characters from either side of the specified string.
What is the Syntax?
The syntax for the Trim function is:
Trim( Argument );
Why might I want to use this?
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β.
<< Previous: Character (Chr) | Next: Selective Trim (LTrim and RTrim) >>