You are here: Functions > TRIM()

TRIM()

TRIM() returns a variable length string with any trailing blanks removed.

Optionally, LTRIM() can also be used to remove other specified leading characters.

TRIM() is similar to the LTRIM() function, which removes leading blanks from a string and to ALLTRIM(), which removes leading and trailing blanks.

Note: The trimming operation starts at the trailing edge of the string and will stop as soon as it encounters a character that is not a blank or an optional character.

Function Format

TRIM(C,<"characters_to_remove">)

C is a character string
characters_to_remove is an optional list of non-blank traiing characters to be removed

Examples

TRIM(" AB C ") = " AB C"

TRIM("ABC") = "ABC"

TRIM(" A ") = " A"

TRIM(" 001010 00","0") = " 00101"

TRIM(" 12305123 00","0123") = " 12305"

Given the two fields First and Last, to create a Name field of the form “Last, First”, specify:

TRIM(Last) + ',' + TRIM(First)