> How to trim the leading and trailing white space off of a string?
> 
>  If the variable is "  E              " I need to convert it to "E".

gsub('^[[:space:]]+', '', "   E     ")
gsub('[[:space:]]+$', '', "   E     ")

as in R-2.1.0/library/base/html/grep.html

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to