ExCellerate.Functions.General.Slug (excellerate v0.4.0)

Copy Markdown View Source

Converts a string to a slug by downcasing, replacing spaces and slashes with hyphens, and stripping other non-alphanumeric characters.

Examples

slug('Hello World')    'hello-world'
slug('Hello/World')    'hello-world'
slug('Foo! @Bar#')     'foo-bar'