On Tue, 19 Aug 2003 23:51:07 GMT, "Mark J. Reed" <markjreed / mail.com>
wrote:

>The ? operator is what you're looking for:
>
>irb(main):001:0> puts ?f
>102

Sorry, I wasn't completely clear.  In my problem the character I want
to find the code for is (has to be!) in a variable.

foo = "f"
puts foo[0]

works at the moment, but may not continue to do so.

foo = "f"
puts ?foo

doesn't work, of course!