From: Robert Dober Date: 2009-02-01T03:50:57+09:00 Subject: Re: ruby string question On Sat, Jan 31, 2009 at 7:40 PM, Tsunami Scripter 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