I program in WPF C#. I have e.g. the following path:
C:\\Program Files\\hello.txt
and I want to extract hello
hello
string Location = "C:\\Program Files\\hello.txt"; string FileName = Location.Substring(Location.LastIndexOf('\\') + 1);