Although it’s not really an operator - more a literal, which is
evaluated as the program is parsed.
For an operator (which applies to a runtime data value), try:
str[0] – ruby 1.8.x
str.ord – ruby 1.9.x
Surprisingly, String#ord doesn’t appear to have been backported to
1.8.7, although Integer#chr has.
Warning: strings in ruby 1.9 are really, really complicated. I got some
way towards reverse-engineering them, then gave up after documenting
about 200 behaviours.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.