Problem
You want to see the ASCII code for a character, or transform an ASCII code into a string.
Solution
To see the ASCII code for a specific character as an integer, use the ? operator:
?a # => 97 ?! # => 33 ? # => 10
To see the integer value of a particular in a string, access it as though it were an element of an array:
'a'[0] # => 97 'bad sound'[1] # => 97
To see the ASCII character corresponding to a given number, call its #chr method. This returns a string containing only one character:
97.chr # => "a" 33.chr # => "!" 10.chr # => " " 0.chr # => "