Trim
The Trim function is used for text manipulation, enabling the removal of spaces from a given text string. It accommodates both a text string and an optional direction as input parameters, allowing users to precisely control the trimming process. When executed, this function returns a modified version of the input text, with spaces eliminated according to the specified direction. If no direction is explicitly provided, the default behavior is to remove all spaces ('ALL'):
■ | LEFT |
■ | RIGHT |
■ | ALL |
Syntax
Trim(string text, string direction)
Example
Trim(" My name is? ","LEFT")-> returns 'My name is? '
Trim(" My name is? ","RIGHT")-> returns ' My name is?'
Trim(" My name is? ","ALL")-> returns 'My name is?'
Trim(" My name is? ","")-> returns 'My name is?'