From: Mark Probert Date: 2002-02-05T04:15:40+09:00 Subject: newbie: Array element conversion
Hello.

I have an array of numbers as strings that I want to
convert to individual numbers.

Naively, I tried

        > a = ["100", "487", "23"]
        > x, y, z = a.each { |s| s.to_i }

but I only get the strings back. I know that a[0].to_i
works but I am not sure how to get it to work over
each element of the array, correctly.

Can some kind soul please help me?

TIA,


-mark

-----
Mark Probert
GNPS - Optera Metro 3000
Tel (613) 768-1082 (ESN: 398-1082)
Mob (613) 715-2045
email: probertm@nortelnetworks.com