TRIM(x,y)

TRIM(x,y) is a string function that removes all of the characters specified in the character string y from the start of the character string  x. The result of TRIM(x,y), therefore, starts with the first character that was not specified in y.

TRIM(x,y) also removes the blanks (code attribute ASCII, UNICODE) from the end of the character string x and then all of the characters specified in the character string y. The result of TRIM(x,y), therefore, ends with the last character that was not specified in y.

Result of the TRIM(x,y) function

TRIM(x)

Spaces only (code attribute ASCII, UNICODE) are removed from x.

x is a NULL value

NULL value

Examples

SQL Tutorial, Changing Character Strings

See also:

LTRIM(x,y)

RTRIM(x,y)