@tempots/std

rpad() function

Pads a string on the right 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:

rpad: (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.