Remove whitespace
str_trim2.RdRemoves whitespace from the left and right sides of a string.
Examples
#----------------------------------------------------------------------------
# str_trim2() examples
#----------------------------------------------------------------------------
library(bkbase)
x <- " example "
str_trim2(x)
#> [1] "example"
str_trim2(c(" a ", "\tb\n", NA))
#> [1] "a" "b" NA
str_trim2("--x--", whitespace = "-")
#> [1] "x"