oostwijk
asked on
Easy Question
Hello, Can someone tell me how to write this code ? I want to strip of the extension (including dot) of a variable.
I've something in mind like this:
$filename="File.txt";
This variable must be stripped..so that I will get
$filename="File";
Hope that you can help me out.
I've something in mind like this:
$filename="File.txt";
This variable must be stripped..so that I will get
$filename="File";
Hope that you can help me out.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If there are more than one dots, would you want to strip all of them or just the last one?
ASKER
That's what I mean, perhaps you could also take a look at my other question
'Easy Question 2'
Keep up the good work.
'Easy Question 2'
Keep up the good work.
Eg file.txt.mine
$filename=~ s/(.*)\..*$/$1/;
print $filename;