
Last chance! 50% off unlimited learning
Sale ends in
StrPad
will fill a string x with defined characters to fit a given length.StrPad(x, width, pad = " ", adj = "left")
"left"
, "right"
, "center"
. If set to "left"
the old string will be adjusted on the left and the new characters will be filled in on the right side.StrPad("My string", 25, "XoX", "center")
# [1] "XoXXoXXoMy stringXXoXXoXX"
Run the code above in your browser using DataLab