Solved

Strip out file name without extension - c#

Posted on 2009-04-07
4
715 Views
Last Modified: 2012-05-06
How can I strip get just the file name from a file, without the extesnion? I'd like to strip out the name of the file, for example, MyFile.ppt, all I want is MyFile? Is there a way to do this in c#? I think this is simple, but for some reason I'm drawing a blank.
0
Comment
Question by:dodgerfan
  • 3
4 Comments
 
LVL 23

Expert Comment

by:apresto
ID: 24087128
System.IO.Path.GetFileWithoutExtension("myFile.ppt")
 
0
 
LVL 23

Accepted Solution

by:
apresto earned 500 total points
ID: 24087137
correction:

System.IO.Path.GetFileNameWithoutExtension("myFile.ppt");

Open in new window

0
 

Author Closing Comment

by:dodgerfan
ID: 31567495
Perfect, thank you very much!
0
 
LVL 23

Expert Comment

by:apresto
ID: 24087441
You're welcome, glad to help
Apresto
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now