本MySQL教程将学习如何使用MySQL RTRIM函数。
MySQL RTRIM函数将删除字符串右侧的所有空格字符。
MySQL中RTRIM函数的语法为:
RTRIM( string )
MySQL RTRIM函数示例
-- 空格
mysql>
SELECT
RTRIM(
'sea evergreen '
);
Result:
'sea evergreen'
-- 只删掉右侧的空格
' abc '
' abc'
-- tab键 也属于空白符号
'igiftidea.com '
'igiftidea.com'
-- 转义符\t 表示tab键也属于空白符
'igiftidea.com \t'
原文链接:https://codingdict.com/