Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Strip out file name without extension - c#

Posted on 2009-04-07
4
Medium Priority
?
725 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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