tags:

views:

29

answers:

2

Hello,

I'm looking for a way in C# to search a string for the file and it's extension. So for example if I have a string "//houtestserver/common/file1.pdf" how can I set another string to file1.pdf?

Thanks everyone in advance

+4  A: 

System.IO.Path.GetFileName("//houtestserver/common/file1.pdf"); will return "file1.pdf". Is that enough for your needs?

ZombieSheep
+1  A: 

string filename = Path.GetFileName(path);

plinth