Skip to main content

padEnd

_.padEnd(length, string) # Ⓢ [Ⓣ][1] Ⓝ

Pads string on the right side if it's shorter than length. Padding



characters are truncated if they exceed length.

Since​

4.0.0

Arguments​

  1. length (number): The padding length.
  2. string (string): The string to pad.

Returns​

(string): Returns the padded string.

Example​

_.padEnd(6, 'abc');
// => 'abc '

_.padEnd([6, '_-'], 'abc');
// => 'abc_-_'

_.padEnd(3, 'abc');
// => 'abc'