Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by swampyankee (Parson)
on Dec 13, 2006 at 16:07 UTC ( #589606=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)

Just so users of more traditional languages don't get left out:

IMPLICIT NONE ! Fortran's equivalent to use strict;use warnings CHARACTER(len=*),PARAMETER,DIMENSION(4) :: in = (/' one', 'two', 'thr +ee ', 'four'/) DO n = SIZE(n),2, -1;WRITE(*,'(a,",",1x)',advance = 'no') TRIM(ADJUSTL +(in(n)));ENDDO WRITE(*,'(a)') TRIM(ADJUSTL(in(1))

OOPS! forgot to split it. I've written a split routine in Fortran (without, alas, regex support). It's actually quite easy, especially since, in Fortran, storage for everything in an argument list is responsibility of the caller. My next feat will be to include regex support....

emc

At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-08-22 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (165 votes), past polls