Hi > > Dear R users, > > I have some trivial query. > > I have a string, I want to remove space from the string. > > For eg. > > Input: > a <- " Remove space " > > Output required: > "Removespace"
It seems to be simple. Even myself with very poor knowledge of regexpr can suggest solution. gsub(" ", "", a) Regards Petr > > I tried using str_trim but only removes end spaces. library(stringr). > > Regards > Vikram > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.