Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by moklevat (Priest)
on Dec 12, 2006 at 19:57 UTC ( [id://589384]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    reverseWords <- function(words) {
         return( sort( words, decreasing=TRUE))
    }
    
  2. or download this
    reverseWords <- function(words) {
      return( paste( rev( unlist( strsplit( words, split=" "))), sep=" ", 
    +collapse=" "))
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://589384]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-24 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found