Hi --

On Fri, 25 Aug 2006, ara.t.howard / noaa.gov wrote:

> On Fri, 25 Aug 2006, Jeremy Lizt wrote:
>
>> Is there an alternative method to String#to_i that will return nil
>> instead of zero for invalid numerical strings?
>
>  int = Integer string

That will raise an ArgumentError if string is invalid for the purpose.


David

-- 
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
   ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com        => D[avid ]A[. ]B[lack's][ Web]log
http://www.manning.com/black     => book, Ruby for Rails
http://www.rubycentral.org       => Ruby Central, Inc.