From: ts Date: 2003-11-17T10:23:27+09:00 Subject: Re: to_i >>>>> "A" == Artur Merke writes: A> Is there a way to recognize if the conversion was successful? If A> "0".to_i and "any string".to_i deliver the same result, I don't see how A> this could be accomplished, without separately checking the syntax of the A> given string. You have the method Integer to do this svg% ruby -e 'p Integer("0")' 0 svg% svg% ruby -e 'p Integer("hello")' -e:1:in `Integer': invalid value for Integer: "hello" (ArgumentError) from -e:1 svg% svg% ruby -e 'a = Integer("hello") rescue 12; p a' 12 svg% -- Guy Decoux