in reply to Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)

How is pike not on here yet?
string reverseWords(string s) { return (reverse(s / " ") - ({ "" })) * " "; }

Have you guys seen the pleac project?

  • Comment on Re: Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell) (pike?)
  • Download Code

Replies are listed 'Best First'.
Re^2: Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell) (pike?)
by mreece (Friar) on Jan 07, 2007 at 05:34 UTC
    return (reverse(s / " ") - ({ "" })) * " "; 
    

    now, that is cool!