SyntaxFix
Write A Post
Hire A Developer
Questions
Shorter way :
import re cleanString = re.sub('\W+','', string )
If you want spaces between words and numbers substitute '' with ' '