Selective Trim (LTrim and RTrim)
What are they?
The LTrim and RTrim functions work in much the same way as the standard Trim function, but instead of trimming both sides of the input string, they trim only one.
What is the Syntax?
The syntax for LTrim and RTrim are as follows:
LTrim( Argument );
RTrim( Argument );
Why might I want to use this?
Although the Trim function is useful for removing all whitespace from either side of the string, you may in fact want to keep spaces on one particular side. In cases like this, you can use the LTrim and RTrim functions to selectively remove one side’s worth of whitespace, but not another. If you start with the string “ Tom ”, using LTrim gives you “Tom ”, while RTrim gives you “ Tom”.
<< Previous: Trim | Next: Evaluating Numeric Data as Strings >>