strpad {tmcn} | R Documentation |
Pad a string to a specified length with a padding character.
strpad(string, width = 0, side = c("left", "right", "both"), pad = " ")
string |
A character vector. |
width |
The number of characters of the string after padding. |
side |
Which side to pad. |
pad |
The padding character. |
A character vector after padding.
Jian Li <rweibo@sina.com>
strpad(1:5, width = 4, pad = "0")