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?
(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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: remove the part of the string that is after the second to last '/'
by dragonchild (Archbishop) on Mar 07, 2002 at 21:46 UTC | |
Re: remove the part of the string that is after the second to last '/'
by virtualsue (Vicar) on Mar 07, 2002 at 23:20 UTC | |
Re: remove the part of the string that is after the second to last '/'
by ajwans (Scribe) on Mar 07, 2002 at 21:46 UTC | |
Re: remove the part of the string that is after the second to last '/'
by abaxaba (Hermit) on Mar 08, 2002 at 06:52 UTC | |
Re: remove the part of the string that is after the second to last '/'
by SgtClueLs (Novice) on Mar 07, 2002 at 22:33 UTC | |
by Juerd (Abbot) on Mar 08, 2002 at 09:10 UTC |
Back to
Seekers of Perl Wisdom