padStart()

Prepends a string with a filler string so that the length of the string is always at least a certain length.

This function is valid in v2.0.0 to v2.14.0. This function has been downloaded 46 times.

Parameters

{string} str
The string to prepend a filler string to.
{number} maxLength
The maximum length allowed for the returned string. If this is less than str.length, this will be set to str.length.
{string=} opt_fillString Optional, Default:" "
The string to repeatedly prepend to str until the length reaches maxLength.

Returns

{string}
Returns str with the filler string prepended to it as many times as necessary until maxLength is reached.