From: Robert Dober Date: 2006-07-26T22:38:44+09:00 Subject: Re: gsub ------=_Part_24521_1022779.1153921120857 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 7/26/06, Matthew Harris wrote: > > Alternatively you can reverse, sub, reverse, but I like Vince's way. > [SNIP] OP talked about the last occurence, not an occurence at the end, so anchoring is not an option :( reverse sub reverse is a nice idea, I hope you do not mind me spelling it out s.reverse.sub(r,"").reverse and in case U want inline replacement s.reverse!.sub!(r,"").reverse! # That is rubyish, isn't it :] Cheers Robert --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_24521_1022779.1153921120857--