Returns a string with no trailing space characters.

Syntax

TRIM(<expC>)

<expC>

The string from which you want to remove the trailing space characters.

Description

TRIM( ) returns a character expression with no trailing space characters. TRIM( ) is identical to RTRIM( ).

To remove trailing blanks before concatenating a string to another string, use the - operator instead of the + operator.

Warning!

Do not create index expressions with TRIM( ) that result in key values that vary in length from record to record. This results in unbalanced indexes that may become corrupted. Use the - operator, which relocates trailing blanks without changing the resulting length of the concatenated string.

To remove leading space characters from a string, use LTRIM( ).

Other than the syntactic difference of being a method instead of a function, the rightTrim( ) method behaves identically to the TRIM( ) function.