From: Austin Ziegler Date: 2002-07-05T21:49:56+09:00 Subject: Re: is there a better string.each? On Fri, 5 Jul 2002 15:56:27 +0900, Juergen Katins wrote: > do i loop over all the characters? > > String.each does not sepaerate each character (as one would > normally assume) but seperates lines (by default, using the record > seperator). Maybe it would have better been named > string.each_record. You can specify the seperator: str.each( > aString=$/ ) example: [snip] > Unfortunately you can not use string.each("") to seperate after each > character. Is there any practical reason why $/ -- or at least the argument to string.each cannot be a regex? After all, it seems to me that '' is behaving like /\n+/m -- and I personally find that Surprising, even though it's documented. I can understand perhaps why $/ might not be best suited for regex handling, but why not allow at least the argument to each either be string or regex? -austin -- Austin Ziegler, austin@halostatue.ca on 2002.07.05 at 08.45.55