trim
trimβ
descriptionβ
Syntaxβ
VARCHAR trim(VARCHAR str[, VARCHAR rhs])
When the 'rhs' parameter is not present, remove the continuous spaces that appear from the starting and ending of the 'str' parameter. Otherwise, remove 'rhs'.
exampleβ
mysql> SELECT trim(' ab d ') str;
+------+
| str |
+------+
| ab d |
+------+
mysql> SELECT trim('ababccaab','ab') str;
+------+
| str |
+------+
| cca |
+------+
keywordsβ
TRIM