From: David Alan Black Date: 2002-01-22T02:59:40+09:00 Subject: Re: Return the ASCII code ? Hello -- On Tue, 22 Jan 2002, D De Villiers wrote: > Hello! > > Newbie's question: > > In the Integer class you can return string containing the ASCII character > represented by the receiver's value: > > 65.chr -> "A" > > How can you get the ASCII code from a character ? With something like: > > "A".asc -> 65 > > The String class doesn't seam to have such a method (asc ?) or anything > similar. Funny you should include that question mark :-) ruby -e 'puts ?a' 97 David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav