Skip to content

Instantly share code, notes, and snippets.

@BernardOng
Created August 22, 2016 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardOng/da8540e9536191d340ad432aad78880f to your computer and use it in GitHub Desktop.
Save BernardOng/da8540e9536191d340ad432aad78880f to your computer and use it in GitHub Desktop.
def remove_non_ascii(self, text):
# removes all non-ascii characters
return ''.join([i if ord(i) < 128 else '' for i in text])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment