SyntaxFix
Write A Post
Hire A Developer
Questions
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