python中有没有函数可以一次性去除空格,换行符,制表符

如题所述

import re
str='1    2\t3\n4'
print(''.join(re.split(' |\t|\n',str)))
温馨提示:答案为网友推荐,仅供参考
相似回答