Function kebabCase

  • It will convert the given string to kebab case.

    Parameters

    • string: string

    Returns string

    Since

    1.0.0

    Example

    kebabCase("camelCase");
    // => "camel-case"

    Example

    kebabCase("some text");
    // => "some-text"

    Example

    kebabCase("some-mixed_string With spaces_underscores-and-hyphens");
    // => "some-mixed-string-with-spaces-underscores-and-hyphens"

    Example

    kebabCase("AllThe-small Things");
    // => "all-the-small-things"

    Example

    kebabCase("IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML");
    // => "i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"