Pad a string to guarantee that it is at least size
length by
filling with the character ch
at either the start or end of the
string. Pads at the start, by default.
Parameter |
Type |
Usage |
Description |
text |
String |
required |
the string to pad |
size |
Integer |
required |
length to provide padding |
ch |
String |
optional |
character to pad, defaults to '0' |
end |
Boolean |
optional |
adds padding at the end if true, otherwise pads at start |
Examples