From: Sean Russell Date: 2002-07-09T13:05:39+09:00 Subject: Re: is there a better string.each? Hal E. Fulton wrote: > Better perhaps to try it in Ruby awhile > fbefore making an RCR: > > class String > def chars > self.split("") > end > def each_char > self.each_byte {|b| yield b.chr } > end > end As I've said before, this is a nice solution, Hal. However, I would expect that native support for this would be faster, and when one is itterating over characters, speed can quickly become an issue. I was hoping for something faster than split(''), which is also not very memory efficient, creating an arbitrary Array object in the process. --- SER