-- 不会处理中间的space
trim(' ab c ')-- 'ab c'
ltrim(' abc ')-- 'abc '
rtrim(' abc ')-- ' abc'-- 删除首尾指定char
trim('9'from'991292199')--'12921'
trim(leading '9'from'991292199')--'1292199'
trim(trailing '9'from'991292199')--'9912921'
rpad('abc',5,'+')--'abc++'
rpad('abc',1,'+')--'a', 截取
rpad('abc',0,'+')--null
replace translate
-- replace(source, search, replace)replace('abc abc','ab','1');-- '1c 1c'-- translate(expr, from, to), 逐个字符对应替换
tranlate('abc a b c ab bc ac','abc','xyzm')-- 'xyz x y z xy yz xz'
translate('abcd 1234','23','')-- 总是返回null-- 验证数字, to参数为空格
trim(translate('a123456789','0123456789',' '))isnull
正则
regexp_instr regexp_substr regexp_replace
regexp_instr('a1234b','[0-9]+')-- 2
regexp_substr('a1234a','\d+',4)-- '34'
regexp_replace('a12a34a','\d+','00')-- 'a00a00a'-- 实现trim
regexp_replace('991292199','^9+','')-- '1292199', 相当于leading trim
regexp_replace('991292199','9+$','')-- '9912921', 相当于trailing trim