GuobaGuoba Utils

dash

@guoba-ai/utils / string / dash

Function: dash()

function dash(str): string;

Defined in: string.ts:164

Convert a string to kebab-case (dash-case).

Parameters

str

string

The string to convert

Returns

string

The kebab-case version of the string

Example

dash('fooBar') // 'foo-bar'
dash('FooBar') // 'foo-bar'
dash('foo_bar') // 'foo-bar'

On this page