Jump to content
Sign in to follow this  
Dryden

Help triming a variable

Recommended Posts

Dryden

Hi! Need some help guys! This is my problem:

In my script I have a variable that leads to a path, for example how do I trim it to erase the path and it only shows the executable without \ and .exe

for example:

my variable at a given point might be:

$var="c:\prog\prog.exe"

or it could be

$var="prog2.exe"

what I'm looking for is for a way to transform it in

$var="prog"

or

$var="prog2"

thx in advance


"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.

Share this post


Link to post
Share on other sites
BrettF

Share this post


Link to post
Share on other sites
Dryden

thx guys. that helped a lot! :P


"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×