Solved

Strip out file name without extension - c#

Posted on 2009-04-07
4
717 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

25 Experts available now in Live!

Get 1:1 Help Now