Possible Duplicate:
Safe integer parsing in Ruby
int.Parse
converts a string into an integer, but throws an exception if the string cannot be convert. int.TryParse
doesn't throw an error when it can't convert the sting to an int, but rather returns 0
and a bool
that says whether the string can be converted.
Is there something similar in Ruby?