From: furufuru@... (Ryo Furue) Date: 2002-01-07T22:58:27+09:00 Subject: Re: How to convert character code to a String? matz@ruby-lang.org (Yukihiro Matsumoto) wrote in message news:<1010361965.562920.6103.nullmailer@ev.netlab.jp>... > Hi, > > In message "[ruby-talk:30347] How to convert character code to a String?" > on 02/01/06, Ryo Furue writes: > > |expect there's a straight forward way to obtain a String from a > |character code. If there's no built-in way, that's OK, and I'll > |define a method like "char" above or add an method to the Fixnum > |class. > > Fixnum#chr Thank you, Kent and Matz! Yes, I was missing something (semi-)obvious. As Kent said, it's Integer#chr. Of course, Integer is a superclass of Fixnum.... Just out of curiosity, this makes me wonder why it isn't Fixnum#chr. Is that because you envision a future where Ruby handles four-byte characters (assuming a Fixnum is 31 bits or longer)? Finally, a feeble excuse :-) I didn't find #chr because I checked Fixnum but not Integer. This is the reason why I said "(semi-)obvious". BTW, I bought a copy of "Ruby in a Nutshell" today. The book is a nice handy reference. I'm happy with it. Thanks again, Ryo