Pads string on the right side if it's shorter than length. Padding characters are truncated if they exceed length.
string
length
The string to pad.
The padding length.
The string used as padding.
Returns the padded string.
5.12.0
padEnd('abc', 6)// => 'abc 'padEnd('abc', 6, '_-')// => 'abc_-_'padEnd('abc', 2)// => 'abc' Copy
padEnd('abc', 6)// => 'abc 'padEnd('abc', 6, '_-')// => 'abc_-_'padEnd('abc', 2)// => 'abc'
Pads
string
on the right side if it's shorter thanlength
. Padding characters are truncated if they exceedlength
.