padRight
Pads the right side of a string to a target length.
padRight
Signature
typescript
function padRight(str: string, length: number, char?: string): stringParameters
str- The string to padlength- The target lengthchar- The character to pad with (default: space)
Returns
Padded string.
Examples
typescript
import { padRight } from 'strio'
padRight('5', 3, '0')
// "500"
padRight('hello', 10)
// "hello "