Robert Dober
1/31/2009 6:51:00 PM
On Sat, Jan 31, 2009 at 7:40 PM, Tsunami Scripter <lyon2003@lycos.com> wrote:
> Is it possible to modify an existing ruby string without creating a new
> one ?
yes
>
> If for example I have the following code :
>
> x = "first string"
> x "second string"
x.clear << "second string"
x.sub! /first/, "second"
x[0..4] = "second"
> I would like to know how I could get to an empty string from "first
> string".
I guess my first example answers this.
HTH
Robert
--
It is change, continuing change, inevitable change, that is the
dominant factor in society today. No sensible decision can be made any
longer without taking into account not only the world as it is, but
the world as it will be ... ~ Isaac Asimov