pad_string {ubiquity} | R Documentation |
Adds spaces to the beginning or end of strings until it reaches the maxlength. Used for aligning text.
pad_string(str, maxlength = 1, location = "beginning")
str |
string |
maxlength |
length to pad to |
location |
either |
Padded string
pad_string("bob", maxlength=10)
pad_string("bob", maxlength=10, location="end")