From: Michael Campbell Date: 2004-02-12T10:00:28+09:00 Subject: Re: (noob) cast string to array? Simon Strandgaard wrote: > What you has written is the same as (notice the '!' suffix) > > result.sub!(/\{/,'[') > result.sub!(/\}/,']') > > Above can be chained, so it becomes > > result.sub!(/\{/,'[').sub!(/\}/,']') > > >>Any suggestions are more than welcome. > > > Try 'gsub' > > result.gsub!(/\{/,'[').gsub!(/\}/,']') > Very dangerous. If one of the ! methods doesn't actually do anything, it returns nil, which responds poorly to subsequent ! methods. __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html