Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: searching backwards in a string

by Kevman (Pilgrim)
on Jun 13, 2000 at 23:47 UTC ( [id://17962]=note: print w/replies, xml ) Need Help??


in reply to searching backwards in a string

Being new to perl, please dont flame me.
But, why cant you store the string in reverse in another string, and then work forwards...
Eg.
my($str) = "abcdefgh"; my($str_rev); print "before $str\n"; $str_rev = reverse($str); print "after $str_rev \n";
This sets str_rev to "hgfedcba".

Replies are listed 'Best First'.
RE: Re: searching backwards in a string
by visnu (Sexton) on Jun 14, 2000 at 03:30 UTC
    i was thinking about that, but that's just horrid when you think about what's going on underneath compared to what the ideal case would be...
      For a "new" user of perl (me), its an adequate way round the problem until a person gains more knowledge.
      You shouldn't dismiss this out of hand.

      Kevman

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found