# NOT RUN {
x <- " Some text. "
x
trimws(x)
trimws(x, "l")
trimws(x, "r")
## Unicode --> need "stronger" 'whitespace' to match all :
tt <- "text with unicode 'non breakable space'."
xu <- paste(" \t\v", tt, "\u00a0 \n\r")
(tu <- trimws(xu, whitespace = "[\\h\\v]"))
stopifnot(identical(tu, tt))
# }
Run the code above in your browser using DataLab