Converts a string to a URL-friendly slug. Lowercases, removes diacritics, strips non-word characters, and replaces spaces with hyphens.
The input string.
slugify("Hello, World!") // => "hello-world"slugify(" Foo Bar ") // => "foo-bar" Copy
slugify("Hello, World!") // => "hello-world"slugify(" Foo Bar ") // => "foo-bar"
Converts a string to a URL-friendly slug. Lowercases, removes diacritics, strips non-word characters, and replaces spaces with hyphens.