From: David Alan Black Date: 2002-07-09T05:55:28+09:00 Subject: Re: is there a better string.each? Hello -- On Mon, 8 Jul 2002, Austin Ziegler wrote: > If $/ (the argument to String#each) could be made to accept regex, > then the record separator could be String#each(//) if necessary, > allowing character-by-character parsing. This is not currently > possible. I'll put in (yet another :-) plug for String#split: str.split(//).each ... I think the idea of having String#each take a regex is, essentially, a kind of compression of this -- in other words, instead of #split'ing on a regex and then iterating through the resulting array, moving the regex intelligence into the argument to #each. I'm of two minds about the merits of this, but in any case I don't think there would be anything possible in the language that isn't possible now. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav