RSiteSearch("trim") will give you a lot of answers.  You cal also use the 
higher level function trim{R.oo} i.e.:

library(R.oo)
x="    e  "
trim(x)
[1] "e"


>From: Omar Lakkis <[EMAIL PROTECTED]>
>Reply-To: Omar Lakkis <[EMAIL PROTECTED]>
>To: [email protected]
>Subject: [R] trim a string
>Date: Fri, 17 Jun 2005 13:34:36 -0400
>
>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".
>
>______________________________________________
>[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

______________________________________________
[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