Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The TRIM function returns the specified text string as a String value after it replaces tab, carriage return, line feed, and form feed characters with a single space character. It also removes leading and trailing spaces and removes multiple spaces between words.
Syntax
TRIM (text)
Arguments
text: String
The valid path of a data source of the String type.
Return values
String
The resulting text value.
Usage notes
In some cases, you might want to remove leading and trailing spaces but prefer to keep formatting for the specified text. For example, when this text represents an address that you enter in the multi-line text box and could contain line feed and carriage return formatting. In this case, use the following expression: REPLACE(text,"^[ \t]+|[ \t]+$","", true) where text is the argument that refers to the specified text string.
Example 1
TRIM (" Sample text ") returns "Sample text".
Example 2
TRIM (CONCATENATE (CHAR(10), " Sample ", CHAR(9)," text ", CHAR(13))) returns "Sample text".