📅  最后修改于: 2022-03-11 14:45:47.416000             🧑  作者: Mango
import re
mystr = "I want to Remove all white \t spaces, new lines \n and tabs \t"
print re.sub(r"\W", "", mystr)
Output : IwanttoRemoveallwhitespacesnewlinesandtabs