How to convert between ascii code and char in Ruby

Sunday, 28 February 2010, 0:11 | Category : Ruby on Rails
Tags : ,

For converting integer to character, you can use .chr, like below
97.chr is equivalent to “a”

Similarly, for converting back from char to ascii code, use ?
?a is equivalent to 97