On Thu, 9 Dec 2004 22:19:55 +0900 Glenn Parker <glenn.parker / comcast.net> wrote: > trans. (T. Onoma) wrote: > > On Wednesday 08 December 2004 10:00 am, Florian Frank wrote: > > | > > | "abc\n\ndef\nghi".split(/\n+/) > > > > Sorry, what are you pointing out here? > > It is impossible to have perfect forwards-backwards symmetry with split > and join. When the split pattern matches more than one possible string > of characters, there is no way to join the results of the split and > recover the original input. > That is obvious, but no argument against wanting split and join to be symmetric for fixed split patterns. (On the other hand one could even argue, that we "need" variable join patterns to make it symmetric again. ;) What is important is, that the split('x', -1) trick does not seem to be as well known as it should be. I for one forgot about it, even though I now remember there was a similar thread some time ago. Regards, Brian -- Brian Schröäer http://www.brian-schroeder.de/