"Hee-Sob Park" <phasis / hananet.net> writes: > "Cullen J O'neill" <cjon / sapphire.engin.umich.edu> wrote in message > news:gO2V5.192$6b.469 / srvr1.engin.umich.edu... > > I have a string of numbers like: > > > > "2 3 3.5 5 1.2" > > > > What's the best way to convert this into an array like: > > > > [ 2, 3, 3.5, 5, 1.2 ] > > > How about > > a = s.split.collect {|x| eval x} Only if you can be sure s is not "2 3 3.5 exit 1.2" :) -spc