TRIM()
TRIM([specifier
remove
FROM]str
)
Returns the string str
with all
prefixes or suffixes removed. The specifier
can be one of BOTH
, LEADING
, or TRAILING
. If no
specifier
is supplied, then BOTH
is assumed. The
remove
string is optional; if it is
omitted, spaces are removed. This code returns the strings “No
Padding” and “Hello__”:
SELECT TRIM(' No Padding '); SELECT TRIM(LEADING '_' FROM '__Hello__');