Learn Ruby

Wednesday, July 05, 2006

 

Integer#chr

若是使用getc, readchar读取IO的字符,结果会是一个0~255的整数。若想将其转换成字符,可以用chr method.比如
irb(main):001:0> 98.chr
=> "b"
reference

Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

July 2006   April 2007  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]