Skip to content

capitalize

String.capitalize(target)

Capitalizes the first letter of target string.

Example

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

String.capitalize("hello world"); // "Hello world"
String.capitalize("hello"); // "Hello"
ts
import { String } from "@monstermann/string";

pipe("hello world", String.capitalize()); // "Hello world"
pipe("hello", String.capitalize()); // "Hello"