Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created March 27, 2012 13:47
Show Gist options
  • Save jacobh/2216021 to your computer and use it in GitHub Desktop.
Save jacobh/2216021 to your computer and use it in GitHub Desktop.
def slugify(input):
allowed = "abcdefghijklmnopqrstuvwxyz0123456789"
output = ""
for letter in input.lower():
if letter not in allowed:
letter = '-'
output = output + letter
return output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment