Mega Code Archive

 
Categories / MySQL Tutorial / String Functions
 

TRIM([{BOTH LEADING TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)

Returns the string str with all remstr prefixes or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr is optional and, if not specified, spaces are removed. mysql> mysql> SELECT TRIM('  rntsoft   '); +---------------------+ | TRIM('  rntsoft   ') | +---------------------+ | rntsoft              | +---------------------+ 1 row in set (0.00 sec) mysql>