From: Julian Leviston Date: 2009-02-02T15:01:29+09:00 Subject: Re: ruby string question x.delete!(x) << "new value" Before and after, the object id will be identical. Sent from my iPhone On 01/02/2009, at 5:40 AM, Tsunami Scripter wrote: > Is it possible to modify an existing ruby string without creating a > new > one ? > > If for example I have the following code : > > x = "first string" > x = "second string" > > between asigning values , the object_id() is different . Is there a > possibility to modify the first string so that after the modifications > the object_id will be the same ? > > I would like to know how I could get to an empty string from "first > string". I would like to know if a clear method exists,or something > alike. I'm using ruby 1.8.7 . > -- > Posted via http://www.ruby-forum.com/. >