Re: [R] remove last char of a text string

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Mon, 14 Jun 2010 10:54:04 -0300

Try:

 gsub(".$", "", c('01asap05a', '02ee04b'))

On Mon, Jun 14, 2010 at 10:47 AM, glaporta <glaporta_at_freeweb.org> wrote:

>
> Dear R experts,
> is there a simple way to remove the last char of a text string?
> substr() function use as parameter start end only... but my strings are of
> different length...
> 01asap05a -> 01asap05
> 02ee04b -> 02ee04
> Thank you all,
> Gianandrea
> --
> View this message in context:
> http://r.789695.n4.nabble.com/remove-last-char-of-a-text-string-tp2254377p2254377.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]


______________________________________________ R-help_at_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.

Received on Mon 14 Jun 2010 - 14:03:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jun 2010 - 14:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive