A utility function that slugify a string

slugifyString('Hello world') // 'Hello-world'
slugifyString('Hello world', '_') // 'Hello_world'
  • Parameters

    • string: string

      The string to slugify

    • delimiter: string = '-'

      The delimiter to use for the slug

    Returns string

    The slugified string