2008/5/12 Robert Klemme <shortcutter / googlemail.com>:
> On 12.05.2008 10:36, Nadim Kobeissi wrote:
>
> > Let's say I have:
> > x=1234
> > How can I convert that to the follow array:
> > x=[1, 2, 3, 4]
> >
> > Any help would be greatly appreciated.
> >
>
>  x.scan /\d/

Ah, not really.  What I meant was:

x.to_s.scan(/\d/).map {|i| i.to_i}

Cheers

robert

-- 
use.inject do |as, often| as.you_can - without end