Skip to content

padStart

padStart(maxLength, fillString?): (s) => string

Defined in: Data/Str.ts:197

Pads the start of a string to a specified length. Data-last: use in pipe.

number

string

(s) => string

pipe("5", Str.padStart(3, "0")); // "005"
pipe("hi", Str.padStart(5));     // "   hi"