P
Phillip Curry
[Note: parts of this message were removed to make it a legal post.]
Is there a nice way to convert a string to an integer if it is in fact an
integer, and to return nil or even an error if it's not? The method to_i
returns 0 if the string is not an integer, which isn't hugely helpful, as I
want to be able to distinguish between the integer 0 and non-integer
strings.
thanks
Is there a nice way to convert a string to an integer if it is in fact an
integer, and to return nil or even an error if it's not? The method to_i
returns 0 if the string is not an integer, which isn't hugely helpful, as I
want to be able to distinguish between the integer 0 and non-integer
strings.
thanks