time-to-botec/js/node_modules/@stdlib/string/left-pad/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

39 lines
848 B
Plaintext

{{alias}}( str, len[, pad] )
Left pads a `string` such that the padded `string` has a length of at least
`len`.
An output string is not guaranteed to have a length of exactly `len`, but to
have a length of at least `len`. To generate a padded string having a length
equal to `len`, post-process a padded string by trimming off excess
characters.
Parameters
----------
str: string
Input string.
len: integer
Minimum string length.
pad: string (optional)
String used to pad. Default: ' '.
Returns
-------
out: string
Padded string.
Examples
--------
> var out = {{alias}}( 'a', 5 )
' a'
> out = {{alias}}( 'beep', 10, 'b' )
'bbbbbbbeep'
> out = {{alias}}( 'boop', 12, 'beep' )
'beepbeepboop'
See Also
--------