[小技巧]批量去除空格 换行 等符号

>>import re
>>p=re.compile('\s+')
>>new_string=re.sub(p,'',your_string)
这是正则表达式的用法,我觉得更有一般性
posted @ 2018-04-19 10:40  bingo彬哥  阅读(1006)  评论(0)    收藏  举报
本站总访问量