Convert a number string in any base to a decimal number

As Brich Thompson notes in the comments on “Convert between number bases easily”, you can also convert a number string in any base to a decimal number with the String#to_i method:

"21".to_i #=> 21 "21".to_i(8) #=> 17 "21".to_i(16) #=> 33