TRIMWHITESPACE(string_exp)

Returns the characters of string_exp with both leading and trailing white space characters (space, tab, new line, carriage return) removed.

 

Example:

SELECT TRIMWHITESPACE(' ABCDE ') returns ABCDE