From: "Hal E. Fulton" Date: 2002-09-10T04:15:10+09:00 Subject: Re: Reading in Hex numbers. ----- Original Message ----- From: "Khurram" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Monday, September 09, 2002 8:31 AM Subject: Reading in Hex numbers. > I want to read in a file that has hex numbers, which are stored with > the "0x" hex prefix (i.e. 0x12345678). Is there a built in function > that will do the conversion, similiar to "to_i", for hex numbers? > > Also... is there something also for binary? Octal? Integer() is probably your best bet, but there is also scanf (see the RAA). scanf will work with hex and octal, though not binary. Hal