KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to divide a string into words, removing spaces and punctuation marks. I tried using the split() method, passing all the punctuation at once, but my results were incorrect: >>> test='hello,how are you?I am fine,thank you. And you?' >>> test.split(' ,.?') ['hello,how are you?I am fine,thank you. And you?'] I actually know how to do this with regexes already, but I'd like to figure out how to do it using split() .
Tags (comma-separated)
Save Edits
Cancel