python快速去除字符串空格换行和制表符

2020-05-22  本文已影响0人  橘子粟粟

避免使用replace一个个替代

import re
print(re.sub('\s|\t|\n','',str)) 
上一篇 下一篇

猜你喜欢

热点阅读