I program in WPF C#. I have e.g. the following path:
C:\\Program Files\\hello.txt
and I want to extract hello
hello
Try this:
string fileName = Path.GetFileNameWithoutExtension(@"C:\Program Files\hello.txt");
This will return "hello" for fileName.