From: ts Date: 2002-09-09T22:36:18+09:00 Subject: Re: Reading in Hex numbers. >>>>> "K" == Khurram writes: K> I want to read in a file that has hex numbers, which are stored with K> the "0x" hex prefix (i.e. 0x12345678). Is there a built in function K> that will do the conversion, similiar to "to_i", for hex numbers? You can try with Integer pigeon% ruby -e 'p Integer("0x12345678")' 305419896 pigeon% pigeon% ruby -e 'p Integer("0b0001110")' 14 pigeon% pigeon% ruby -e 'p Integer("01234567")' 342391 pigeon% pigeon% ruby -e 'p Integer("1234567")' 1234567 pigeon% Guy Decoux