Skip to content

Latest commit

 

History

History
50 lines (29 loc) · 848 Bytes

File metadata and controls

50 lines (29 loc) · 848 Bytes

strings.padEnd

acc


export function padEnd *(string(string, [length], [substr])*

Pads the end of a string w/ repeated spaces|substrings

Arguments

  1. string (string): input string
  2. [length] (number): length of the padded portion *(default 0)*
  3. [substr] (string): substring to apply *(default ' ')*

Returns

(string): the input padded w/ spaces|substrings

Example

// if no `substr` is provided, it pads the string w/ spaces
const result = strings.padEnd('abcabc', 9);
console.log(result);
> abcabc