Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
[Corion]: Hmm - HTC Vive reduces its price to EUR 700 (from EUR 900). Now I have to look what graphics cards prices are - maybe a good enough VR rig can be had for EUR 1500 now instead of EUR 2000(+)
[Corion]: Hmm - nVidia GTX 1070 + Vive makes EUR 1130, leaving EUR 370 for CPU+case+cooler+ RAM - not bad
[Corion]: (I'm not a fan of AMD)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-08-21 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (319 votes). Check out past polls.

    Notices?