[R] Remove all whitespaces

Shekhar shekhar2581 at gmail.com
Thu May 5 13:02:41 CEST 2011


A more elegant way would be:

myString<-"1 2 3 4 5"
myString<-paste(unlist(strsplit(myString," ")),collapse="")

The output will be "12345"

Regards,
Som Shekhar



More information about the R-help mailing list