Skip to content

padStart

ts
function String.padStart(
    target: string,
    length: number,
    fill: string,
): string

Pads target string from the start with fill string until the result reaches the specified length.

Example

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

String.padStart("hello", 10, " "); // "     hello"
ts
import { String } from "@monstermann/string";

pipe("hello", String.padStart(10, " ")); // "     hello"