Skip to content

snakeCase

String.snakeCase(target)

Converts target string to snake_case format.

Example

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

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

pipe("hello world", String.snakeCase()); // "hello_world"
pipe("helloWorld", String.snakeCase()); // "hello_world"