[R] trim a string

Francisco J. Zagmutt gerifalte28 at hotmail.com
Fri Jun 17 20:47:37 CEST 2005

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

x="    e  "
[1] "e"

>From: Omar Lakkis <uofiowa at gmail.com>
>Reply-To: Omar Lakkis <uofiowa at gmail.com>
>To: r-help at stat.math.ethz.ch
>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".
>R-help at stat.math.ethz.ch mailing list
>PLEASE do read the posting guide! 

More information about the R-help mailing list