Jump to content

Help triming a variable


Dryden
 Share

Recommended Posts

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.

Link to comment
Share on other sites

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...