Skip to content

kebabCase

String.kebabCase(target)

Converts target string to kebab-case format.

Example

ts
import { String } from "@monstermann/string";

String.kebabCase("hello world"); // "hello-world"
String.kebabCase("helloWorld"); // "hello-world"
ts
import { String } from "@monstermann/string";

pipe("hello world", String.kebabCase()); // "hello-world"
pipe("helloWorld", String.kebabCase()); // "hello-world"