[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 743
  • Last Modified:

Strip out file name without extension - c#

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
dodgerfan
Asked:
dodgerfan
  • 3
1 Solution
 
aprestoCommented:
System.IO.Path.GetFileWithoutExtension("myFile.ppt")
 
0
 
aprestoCommented:
correction:

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

Open in new window

0
 
dodgerfanAuthor Commented:
Perfect, thank you very much!
0
 
aprestoCommented:
You're welcome, glad to help
Apresto
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now