SyntaxFix
Write A Post
Hire A Developer
Questions
Use the re library
import re myString = "I want to Remove all white \t spaces, new lines \n and tabs \t" myString = re.sub(r"[\n\t\s]*", "", myString) print myString
Output:
IwanttoRemoveallwhitespaces,newlinesandtabs