Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by jettero (Monsignor)
on Dec 12, 2006 at 20:24 UTC ( #589401=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589401]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2016-12-02 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (47 votes). Check out past polls.