Nishi wrote:

I have a string of the format -

abc/def/ghi
or
abc\def\ghi

I want to strip of abc and return just
def/ghi
or
def\ghi

How do I do that?

use strict;
use warnings;

foreach (qw( abc/def/ghi abc\def\ghi )) {
 (my $trim = $_) =~ s|.*?[/\\]||;
 print "$_  ->  $trim\n";
}

**OUTPUT**

abc/def/ghi  ->  def/ghi
abc\def\ghi  ->  def\ghi


HTH,

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to