On Thursday 09 December 2004 08:19 am, Glenn Parker 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.

I see. Well, The -1 parameter was only have the story. The other half of this 
argument was to not let empty strings drop, so the above could produce.

  ["abc","","def","ghi"]

And in that case it certainly is reversible. So I would think that would make 
sense as default, then add method "modes" for the desired variations.

That reminds me, do we have simple way to delete all empty strings from an 
array, like compact is for nil?

T.