SyntaxFix
Write A Post
Hire A Developer
Questions
Another approach can be taken into account
library(stringr) str_replace_all(" xx yy 11 22 33 ", regex("\\s*"), "") #[1] "xxyy112233"
\\s: Matches Space, tab, vertical tab, newline, form feed, carriage return
*: Matches at least 0 times