powered by
Remove leading and trailing spaces (or other character).
rmv.spc(str, before = TRUE, after = TRUE, char = " ")
returns vectors without the leading/trailing characters
character vector, may containing leading or trailing chars
logical, whether to remove leading spaces
logical, whether to remove trailing spaces
an alternative character to be removed instead of spaces
Nicholas Cooper njcooper@gmx.co.uk
spc
rmv.spc(" mid sentence ") rmv.spc("0012300",after=FALSE,char="0") rmv.spc(" change nothing ",after=FALSE,before=FALSE)
Run the code above in your browser using DataLab