postgresql字符串处理函数

删除字符串头部/两端/尾部的指定字符

trim([leading | trailing | both] [characters] from string)

示例

select trim(both 'x' from 'xx123xxx456xxx')
select trim(leading 'x' from 'xx123xxx456xxx')
select trim(trailing 'x' from 'xx123xxx456xxx')

猜你喜欢

转载自blog.csdn.net/leinminna/article/details/113875751