If you have a string ten
, is it possible to convert it to an integer 10
in Ruby? (maybe in rails?)
I value the developers at tryruby.org, and in their tutorial here, it specifically says "to_i converts things to integers (numbers.)" I am wondering why they didn't say "to_i converts STRINGS to integers (numbers.)"
What variable types can be converted from their type to an integer?
Best Answer
Check out this gem for handling word to number conversions.
From the readme: