"Simon Strandgaard" <neoneye / adslhome.dk> schrieb im Newsbeitrag
news:pan.2004.02.12.16.43.18.895279 / adslhome.dk...
> On Thu, 12 Feb 2004 17:35:20 +0100, Robert Klemme wrote:
> > "Koncept" <user / unknown.invalid> schrieb im Newsbeitrag
> > news:120220041122469448%user / unknown.invalid...
> >>
> >> irb(main):001:0> result = '{ "robert","trey","adrian", "pat" }'
> >> => "{ \"robert\",\"trey\",\"adrian\", \"pat\" }"
> >>
> >> irb(main):002:0> result.scan(/"(.*?)"/).flatten
> >> => ["robert", "trey", "adrian", "pat"]
>
>
> Try
>
>   result = result.scan(/"(.*?)"/).flatten
>
>
> >> irb(main):004:0> result.class
> >> => *String*

Dunno what you did, but scan returns an array:

irb(main):004:0> result = '{ "robert","trey","adrian", "pat" }'
=> "{ \"robert\",\"trey\",\"adrian\", \"pat\" }"
irb(main):005:0> result.scan(/"(.*?)"/).flatten
=> ["robert", "trey", "adrian", "pat"]
irb(main):006:0> result.scan(/"(.*?)"/).flatten.class
=> Array
irb(main):007:0> result = result.scan(/"(.*?)"/).flatten
=> ["robert", "trey", "adrian", "pat"]
irb(main):008:0> result.class
=> Array
irb(main):009:0>

    robert