Could you help me for finding the file name from the string. Now i have one string of content like \"C:\\xxxx\\xxxx\\xxxx\\abc.pdf\". But i want only the file name ie. abc.p
Sytem.IO.FileInfo
is also quite cool:
In your case you can do
FileInfo fi = new FileInfo("C:\xxxx\xxxx\xxxx\abc.pdf");
string name = fi.Name; // it gives you abc.pdf
Then you can have several other pieces of information:
does the file really exist? fi.Exists
gives you the answer
what's its extension? see fi.Extension
what's the name of its directory? see fi.Directory
etc.
Have a look at all the members of FileInfo you may find something interesting for your needs