Post
Python
How can I remove all the special characters, punctuations and spaces from a string in python?
Posted on 27th January 2023
Try this example
>>> string = "Hey $#! People howareyou 007"
>>> ''.join(e for e in string if e.isalnum())
'Heypeoplehowareyou007'
STILL GOT QUERIES?
Copyright © 2013 - 2023 MindMajix Technologies