Slugify String

Convert a string to a URL-friendly slug.

Code

General
import re
return re.sub(r'[^a-z0-9]+', '-', str.lower()).strip('-')

Parameters

The string to slugify

Server

More Python Snippets