Skip to content

kebabCase() function

str을 kebab case로 변환합니다. 공백·구두점·숫자·대소문자 경계·두문자어를 기준으로 단어를 분리합니다.

Signature:

typescript
function kebabCase(str: string): string;

Example

ts
kebabCase("foo bar"); // "foo-bar"
kebabCase("fooBar"); // "foo-bar"
kebabCase("foo_bar"); // "foo-bar"
kebabCase("XMLHttpRequest"); // "xml-http-request"

Open Source Code

Released under the Apache-2.0 License.