kebabCase

string

Converts string to kebab case.

Signature

kebabCase(str: string): string

Parameters

NameTypeDescription
strstringThe string to convert

Returns

string - Returns the kebab cased string

Examples

Basic Usage

import { kebabCase } from 'dashlite'

const result = kebabCase('fooBar')
console.log(result)

Output:

foo-bar

With Spaces

import { kebabCase } from 'dashlite'

const result = kebabCase('Foo Bar Baz')
console.log(result)

Output:

foo-bar-baz

Available since version 1.0.0