SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
string fileName = Path.GetFileNameWithoutExtension(@"C:\Program Files\hello.txt");
This will return "hello" for fileName.