As holli suggested you can make use of the above methods.
The string you have mentioned seems to be a path name, if it is so, you can make use of File::Basename.
use File::Basename; $str='/usr/local/prj/code/prog/prog1'; $name = basename("$str"); print "$name";
output:prog1
Prasad
update: added, use File::Basename;
In reply to Re: strip substring from long string
by prasadbabu
in thread strip substring from long string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |