in reply to Re^2: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
in thread Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)
Actually that doesn't work correctly in FF or Safari on OS X. It still has several empty strings filling up the array. They become more evident if you do this:
which gives you "||||four|three|two|||one||"." one two three four ".split(/ /).reverse().join("|")
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by jdporter (Paladin) on Dec 12, 2006 at 16:03 UTC | |
by stvn (Monsignor) on Dec 12, 2006 at 16:09 UTC | |
by AltBlue (Chaplain) on Dec 14, 2006 at 15:04 UTC |