From: Tim Rowe Date: 2003-08-20T19:48:09+09:00 Subject: Re: Newbie Q: Getting character codes On Tue, 19 Aug 2003 23:51:07 GMT, "Mark J. Reed" 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!