《MYSQL數(shù)據(jù)庫mysql trim函數(shù)用法實例》要點:
本文介紹了MYSQL數(shù)據(jù)庫mysql trim函數(shù)用法實例,希望對您有用。如果有疑問,可以聯(lián)系我們。
一,mysql去除左空格函數(shù):
ltrim(str)
returns the string str with leading space characters removed.MYSQL數(shù)據(jù)庫
例子:
?MYSQL數(shù)據(jù)庫
二,mysql去除右空格函數(shù):
rtrim(str)
returns the string str with trailing space characters removed.MYSQL數(shù)據(jù)庫
例子:
?MYSQL數(shù)據(jù)庫
mysql> select rtrim('barbar?? ');
-> 'barbar'MYSQL數(shù)據(jù)庫
this function is multi-byte safe.MYSQL數(shù)據(jù)庫
三,trim函數(shù)可以過濾指定的字符串:
完整格式:trim([{both | leading | trailing} [remstr] from] str)
簡化格式:trim([remstr from] str)MYSQL數(shù)據(jù)庫
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數(shù)據(jù)庫
例子:
?MYSQL數(shù)據(jù)庫
mysql trim函數(shù)清除字段兩邊的空格:
?MYSQL數(shù)據(jù)庫
轉載請注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/6494.html