# align on (the first occuring) B
x <- c("ABCDMNB", "CDGHEBK", "BCI")
cbind(StrAlign(x, sep="B"))
# align to decimal point
z <- c("6.0", "6.00 ", "45.12 ")
cbind(StrAlign(z, sep="."))
# right align, the width will be the max number of characters in x
StrAlign(x, sep="\\$")
Run the code above in your browser using DataCamp Workspace