From: Florian Gross Date: 2004-06-01T22:28:38+09:00 Subject: Re: [bug] String#split returns extra empty string David Alan Black wrote: > Hi -- Moin! >>FYI: I have no idea when this wiping empty tail elements are useful. >>Any ideas ? > > Maybe a case like: > > irb(main):006:0> "one two three ".split(" ") > => ["one", "two", "three"] > > (though there you don't need an argument to split at all I guess) or > something like: > > irb(main):016:0> "one!two!three!".split("!") > => ["one", "two", "three"] Hm, I think that it causes more trouble than it's worth. It's very easy to remove empty elements anyway: "one!two!three!".split("!").reject { |item| item.empty? } Maybe it would be better to create a reject_at_end/at_start or something similar? Regards, Florian Gross