------ art_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 <shugotenshi / gmail.com> 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
--
Deux choses sont infinies : l'univers et la bóŐise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.
- Albert Einstein
------ art_24521_1022779.1153921120857--