Pads a string or number with another string (repeated if necessary) until the resulting string reaches the specified length.
The target string or number.
The minimun length of the resulting string.
The string used for padding. Defaults to '0'.
'0'
The padded string.
console.log(PUtilsNumber.padStart('123', 6)) // '000123'console.log(PUtilsNumber.padStart('123', 6, '_')) // '___123' Copy
console.log(PUtilsNumber.padStart('123', 6)) // '000123'console.log(PUtilsNumber.padStart('123', 6, '_')) // '___123'
Pads a string or number with another string (repeated if necessary) until the resulting string reaches the specified length.