TRIM (TSQL Function)

Returns the string expression, with leading and trailing blanks removed.

Syntax

TRIM  ( string_expression )

Arguments

string_expression
is a string expression of type varchar.

Return Types

Returns varchar.

Examples

PRINT '#' + TRIM('    Hello    ') + '#';

The result is:

#Hello#