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

Re: Re: remove the part of the string that is after the second to last '/'

by Juerd (Abbot)
on Mar 08, 2002 at 09:10 UTC ( [id://150261]=note: print w/replies, xml ) Need Help??


in reply to Re: remove the part of the string that is after the second to last '/'
in thread remove the part of the string that is after the second to last '/'

You weenie! You used a regular expression! :)

I think I like this way of avoiding regexes better:
substr($var, rindex($var, '/', length($var) - 2)) = '';

++ vs lbh qrpbqrq guvf hfvat n ge va Crey :)
Nabgure bar vs lbh qvq fb jvgubhg ernqvat n znahny svefg.
-- vs lbh hfrq OFQ pnrfne ;)
    - Whreq

  • Comment on Re: Re: remove the part of the string that is after the second to last '/'
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (None)
    As of 2024-10-15 20:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.