Removes leading and/or trailing space(s) from a character vector. By default, it removes both leading and trailing spaces.
trim.space(
x,
what = c("both", "leading", "trailing", "none"),
space.regex = "[:space:]",
...
)
a character vector which values need whitespace trimming
which part of the string should be trimmed. Defaults to both
which removes trailing and leading spaces. If none
, no trimming will be performed.
a character value containing a regex that defines a space character
additional arguments for gsub
function
a character vector with (hopefully) trimmed spaces