From: Simon Strandgaard Date: 2004-02-12T09:44:58+09:00 Subject: Re: (noob) cast string to array? On Thu, 12 Feb 2004 00:31:29 +0000, Koncept wrote: > Hi. What a fantastic language. This is my first day learning using it > and I *love* it so far. Great.. Welcome to Ruby. [snip] > > result = result.sub(/\{/,'[') > result = result.sub(/\}/,']') 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!(/\}/,']') -- Simon Strandgaard