|
|
| Perl: the Markov chain saw | |
| PerlMonks |
remove the part of the string that is after the second to last '/'by einerwitzen (Sexton) |
| on Mar 07, 2002 at 16:44 UTC ( [id://150141]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.einerwitzen has asked for the wisdom of the Perl Monks concerning the following question:
I have a string "$var = "one/two/three/four/five/six/";" (note the last ' / ' on it. I need to be able to remove just the last item, leaving the rest as a string, "$var2 = "one/two/three/four/five/"; Is there a simple way to do this?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||