From: Zach Dennis Date: 2004-12-07T16:44:37+09:00 Subject: Re: [rcr] String#split behaves odd Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [rcr] String#split behaves odd" > on Tue, 7 Dec 2004 14:16:06 +0900, "Pe�a, Botp" writes: > > |imho, I think he meant > | > |[] != [""] > | > |I myself thought that string#split would return an array of strings w a > |minimum element of [""] > > I don't get it. [] is an array of strings with zero elements. ;-) There is misleading behavior though with the current implementation. For example: Example1: "aaaab".split( /a/ ) => [ "", "", "", "", "b" ] Example2: "a".split( /a/ ) => [] Example3: "aaaa".split( /a/ ) => [] You would think all three cases would respond the same, but the last examples respond very differently then the first. Should the behavior not be consistent? Zach