trim_wspace
NAME
trim_wspace(): Trim white space characters on both sides of text.TYPE
FunctionDESCRIPTION
As opposed to the standard TRIM() function, which only trims strict space characters (' '), trim_wspace() also trims new line, tab and backspace characters.
SYNOPSIS
trim_wspace(txt TEXT CHARSET utf8) RETURNS TEXT CHARSET utf8
Input:
- txt: text to trim In case of NULL, the function returns NULL.
EXAMPLES
Trim text (spaces between literals are unaffected):
SELECT trim_wspace('\n a b c \n ') AS res;
+-------+
| res |
+-------+
| a b c |
+-------+
Similar to the above, quoted for clarity:
SELECT CONCAT('"', trim_wspace('\n the quick brown fox \n '), '"') AS res;
+-----------------------+
| res |
+-----------------------+
| "the quick brown fox" |
+-----------------------+