From: Paul Lutus Date: 2006-11-30T07:05:13+09:00 Subject: Re: Need a range, but not getting it. . . . Rimantas Liubertas wrote: >> > >> > Your problem was that, although gsub! (with the !) normally modifies >> > the receiver, 'files' wasn't the receiver (to_s was), so you weren't >> > actually changing 'files'. >> >> Not correct. Try it. > >>> files=["im123000-im123006"] > => ["im123000-im123006"] >>> files.to_s.gsub!(/-/,'..') > => "im123000..im123006" >>> files > => ["im123000-im123006"] Because the original example used a string, and yours uses an array, it is not a valid counterexample. Applying ".to_s" to a string has no effect, consequently the receiver is changed. Applying ".to_s" to anything other than a string makes a copy. -- Paul Lutus http://www.arachnoid.com