RTRIM(str)
RTRIM() mysql function returns the string str with trailing space characters removed.
In mysql if you want to remove a white space from the right side of a string then you can use this RTRIM mysql function. RTRIM mysql function remove the all white spaces from the right side from the string.
Here are some examples related to this-
mysql> SELECT RTRIM('Hello MySQL ');
+---------------------------+
| RTRIM('Hello MySQL ') |
+---------------------------+
| Hello MySQL |
+---------------------------+
1 row in set (0.00 sec)
mysql> SELECT RTRIM(' Hello MySQL. Remove spaces from right side ');
+-------------------------------------------------------------------+
| RTRIM(' Hello MySQL. Remove spaces from right side ') |
+-------------------------------------------------------------------+
| Hello MySQL. Remove spaces from right side |
+-------------------------------------------------------------------+
1 row in set (0.00 sec)
0 Comment(s)