fork download
  1. a <- c("I need only <5 white-spaces removed")
  2. # c("Iwant", "only", "<5", "white-spacesremoved")
  3. strsplit(gsub("(?<=\\S)\\s{1,4}(?=\\S)", "", a, perl=TRUE), "\\s+")
Success #stdin #stdout 0.2s 39480KB
stdin
Standard input is empty
stdout
[[1]]
[1] "Ineed"               "only"                "<5"                 
[4] "white-spacesremoved"