Returns a new string of a given length such that the ending of the string is padded.
Install
Install all functions of strman
yarn add strman
or just the rightPad function
yarn add strman.rightpad
Usage
import { rightPad } from 'strman'
// OR
import rightPad from 'strman.rightpad'
Parameters:
Name | Type | Description |
---|---|---|
value |
String | The String! |
_length |
Number | Max length of String. |
char |
Char | Char to repeat. |
- Source:
Returns:
String pad.
- Type
- String
Example
const title = "strman"
rightPad(title, 10, 0)
// => 'strman0000'