get filename from filepath

  • Thread starter Thread starter Nikhil Patel
  • Start date Start date
N

Nikhil Patel

Hi all,
What is the best way to get the file name from the filepath.

For example: I want to get "MyDoc001.xml" from "C:\MyDocs\MyDoc001.xml".

Thanks.
-Nikhil
 
See the System.IO.Path class and it's static methods, like

System.IO.Path.GetFileName( @"c:\mydocs\mydoc001.xml")
 
Back
Top