From: Brian Candler Date: 2009-10-13T18:04:14+09:00 Subject: Re: Tip du jour: no need to chomp before to_i David A. Black wrote: > But it doesn't mind whitespace: > > Integer("\t \n 123\n ") => 123 (leading and trailing whitespace that is) Beware that Integer() as well as being fussier, also implements special treatment of leading 0 (octal) and 0x (hex). >> "0123".to_i => 123 >> Integer("0123") => 83 >> "0x123".to_i => 0 >> Integer("0x123") => 291 -- Posted via http://www.ruby-forum.com/.