Peter Wu-5 wrote:
> 
> s = "1234" [0..1]
> p s      #> "12"
> p s.to_i    #> 12
> s = s[1]
> p s      #> 50
> p s.to_i    #> 50
> 
> I can see the reason for this happening, but I don't want it to happen.
> 
> So how do I make it return 2 instead of 50?
> 
> 
p s[1].chr.to_i    #=> 2



-- 
View this message in context: http://www.nabble.com/Strings-to-int-conversion-tp24227159p24268762.html
Sent from the ruby-talk mailing list archive at Nabble.com.