Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 775 Bytes

slugify.md

File metadata and controls

24 lines (18 loc) · 775 Bytes

slugify (source code)

  • Curried: false
  • Failsafe status: alternative available

The slugify function converts a given string into a slug. A slug is a URL-friendly representation of a string, typically used for creating human-readable and SEO-friendly URLs. This function transforms a string by removing spaces, special characters, and converting it to lowercase to create a valid slug.

Arguments:

  • string: The string to be converted.

Usage:

slugify("My quiz"); // "my-quiz"
slugify("my-quiz"); // "my-quiz"
slugify("-----my----quiz"); // "my-quiz"
slugify("Me & my quiz"); // "me-and-my-quiz"
slugify("my!@#$%^*(quiz"); // "myquiz"