Convert Between Characters And Values
Join the DZone community and get the full member experience.Join For Free
// character to ASCII value: use ?
?a # => 97 ?\n # => 10// string to integer: use 
'a' # => 97 'hallo' # => 97// integer / number to character: use .chr
97.chr # => "a" 10.chr # => "\n"//more info: "Ruby Cookbook", O'Reilly
Opinions expressed by DZone contributors are their own.