powered by
Remove leading and/or trailing white space from character vectors.
trim(s, leading = TRUE, trailing = TRUE, perl = TRUE, …)
a character vector
logical
arguments passed to gsub
gsub
trim removes leading and trailing space, which is defined through the (Perl) regular expression \s.
trim
\s
gsub, strtrim
strtrim
# NOT RUN { s <- c("\t 2 2\n \t", " ab ") trim(s) # }
Run the code above in your browser using DataLab