Last active
April 27, 2019 11:14
-
-
Save jerobado/74a41d5a2e85f77f9c20b629d9574186 to your computer and use it in GitHub Desktop.
Removes special characters in an alphanumeric text.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Special Character Remover - removes special characters in an alphanumeric text | |
import string | |
ALPHANUMERIC = string.digits + string.ascii_letters | |
text = 'JI000 00-2391M/xxxx---------90234' | |
# output 'JI000002391Mxxxx90234' | |
print(''.join([char for char in text if char in ALPHANUMERIC])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment