--- nfo/perl/libs/Data/Mungle/Transform/String.pm 2003/01/19 03:27:36 1.1 +++ nfo/perl/libs/Data/Mungle/Transform/String.pm 2003/01/31 01:22:19 1.2 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: String.pm,v 1.1 2003/01/19 03:27:36 joko Exp $ +## $Id: String.pm,v 1.2 2003/01/31 01:22:19 root Exp $ ## --------------------------------------------------------------------------- ## $Log: String.pm,v $ +## Revision 1.2 2003/01/31 01:22:19 root +## + sub getLastPart +## ## Revision 1.1 2003/01/19 03:27:36 joko ## + initial check-in ## @@ -16,7 +19,7 @@ require Exporter; our @ISA = qw( Exporter ); our @EXPORT_OK = qw( - stripHtml stripSpaces stripNewLines toReal trim + stripHtml stripSpaces stripNewLines toReal trim getLastPart ); sub stripHtml { @@ -66,4 +69,12 @@ return $real; } +sub getLastPart { + my $which = shift; + my $seperator = shift; + $seperator ||= '\/'; + $which =~ m/^.*$seperator(.+?)$/; + return $1; +} + 1;