From: "Peña, Botp" Date: 2008-11-27T16:44:34+09:00 Subject: Re: Alternatives to ?\C-n, ?\M-a etc in ruby 1.9 From: Nit Khair [mailto:sentinel.2001@gmx.com] # > why not create your own String#ord func? # > # > i think string#ord works for both 1.8.7 and 1.9, so you # just have to # > create one for 1.8.6 # I *am* on 1.8.7: # # irb(main):334:0> "a".ord # NoMethodError: undefined method `ord' for "a":String # from (irb):334 oops, sorry, you're right, the #ord in 1.8.7 works only for integer.. >qri ord ... Returns the int itself. ?a.ord #=> 97 This method is intended for compatibility to character constant in Ruby 1.9. For example, ?a.ord returns 97 both in 1.8 and 1.9. i guess you'll really have to create one for 1.8.x