Skip to content

Instantly share code, notes, and snippets.

@graham-thomson
Created February 17, 2016 23:25
Show Gist options
  • Save graham-thomson/5f0131c090e5bf5abb49 to your computer and use it in GitHub Desktop.
Save graham-thomson/5f0131c090e5bf5abb49 to your computer and use it in GitHub Desktop.
python lambda function to remove non-ascii characters from a string
remove_non_ascii = lambda string: "".join(letter for letter in string if ord(letter) < 128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment