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