condense 参数

" 删除左右空格,中间空格压缩至一格
result = condense( '   abc   def   ').
result = condense( val = ' abc def ').

" 删除所有空格
condense result no-gaps.

 

" 字符串根据 from 内容进行替换,from 为空不进行替换
result = condense( val = '   abc   def   ' from = '' ).

" b替换成空格
result = condense( val = '   abc   def   ' from = 'b' ).

 

" del 为空,不删除前后字符串,
result = condense( val = `XXabcXXXdefXX` del = '' from = 'X' to = 'X' ).

result = condense( val = `XXabcXXXdefXX` del = 'X' from = 'X' to = 'X' ).

 

posted @ 2019-07-25 18:11  北斗星君  阅读(637)  评论(0编辑  收藏  举报