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

如题所述

import re
s='dfa \n dfadf\t dfadf\ndfdaf'
t=re.sub('\s','',s)
print(t)

温馨提示:答案为网友推荐,仅供参考
相似回答