in reply to Alternative to Substr?
You can do it with an RE or with substr and index
$str = "abcdefghijklmnopqrstuzwxyz"; $find = "efg"; if ( $str =~ m/\Q$find\E(.*)\z/s ) { printf "Remainder after $find is %s\n", $1; } my $i = index $str, $find; if ( $i != -1 ) { printf "Remainder after $find is %s\n", substr $str, ($i + length( +$find)); }
cheers
tachyon
|
|---|