From: Paul Lutus Date: 2006-09-21T16:05:14+09:00 Subject: Re: Ruby doesn't convert from String to int Yu Co wrote: [ from an earlier post ] >> I have the following peace of code: >> arr = [5, 5, 2002] >> date = Date.new(arr[2].to_i, arr[1].to_i, arr[0].to_i) >> I need to convert the String elements in the array into int. They are already Fixnums. > All right, then I'm wondering why the array doesn't accept Fixnum as an > argument... What? The array does accept fixum as an argument. The arguments you put into the array are Fixnum objects. ----------------------------------------- #!/usr/bin/ruby -w arr = [5, 5, 2002] arr.each do |element| puts element.class end ----------------------------------------- Output: Fixnum Fixnum Fixnum -- Paul Lutus http://www.arachnoid.com