Skip to content

Instantly share code, notes, and snippets.

@rickcnagy
Created January 31, 2014 04:43
Show Gist options
  • Select an option

  • Save rickcnagy/8726723 to your computer and use it in GitHub Desktop.

Select an option

Save rickcnagy/8726723 to your computer and use it in GitHub Desktop.
Filters a string for a certain subset of characters, such as only letters or alphanumeric characters.
# from http://stackoverflow.com/a/12851835/1628796
# returns only the lowercase version of the letters - useful for comparing strings
def alpha(string):
return ''.join([i for i in string if i.isalpha()]).lower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment