@tempots/std

lpad() function

Pads a string on the left with a specified character until it reaches a specified length. If the string is already longer than the specified length, it is returned as is.

Signature:

lpad: (s: string, char: string, length: number) => string

Parameters

Parameter

Type

Description

s

string

The string to pad.

char

string

The character to use for padding.

length

number

The desired length of the padded string.

Returns: string

The padded string.