Use scanf : scanf « Development « Ruby






Use scanf

require 'scanf'
puts s = '0x10 4.44 10'.scanf('%x %f %d')                     # => [16, 4.44, 10]

puts s

 

Related examples in the same category