Solved

Strip out file name without extension - c#

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

630 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