powered by
Pad a string and align within string
padstr(x, n, just = c("center", "left", "right"))
x, padded to be a string of n characters
x
n
string
number of character of the output string, if n < nchar(x) an error is thrown
n < nchar(x)
character(1). Text alignment justification to use. Defaults to center. Must be center, right or left.
padstr("abc", 3) padstr("abc", 4) padstr("abc", 5) padstr("abc", 5, "left") padstr("abc", 5, "right") if (interactive()) { padstr("abc", 1) }
Run the code above in your browser using DataLab