On Sep 21, 8:31=A0am, Timothy Baron <timothy.ba... / gmail.com> wrote:
> Robert Klemme wrote:
> > On Tue, Sep 21, 2010 at 1:33 PM, Timothy Baron <timothy.ba... / gmail.com=
>
> > wrote:
> >> Here's a simple question: What's an effecient way to get the digits of
> >> a number. For instance, if I have the number 37, how can I get "3" and
> >> "7"?
>
> > Five days ago the exact same question was raised here - and answered.
> > What prevented you finding that thread?
>
> > Cheers
>
> > robert
>
> An inability to use the right search phrase? =A0I had looked, but nothing
> relevant came up. =A0Thanks for letting me know about this other thread,
> though. =A0Just found it, and it answers the question nicely.
> --
> Posted viahttp://www.ruby-forum.com/.

One alternative to split could be unpack

s =3D "12345" * 2000

s.unpack('C*').each {|d| printf("%c\n", d)}

note that s contains ascii values for each digit obtained ( '0' =3D>
48, ..., '9' =3D> 57 )