开发者

Search string to find Filename

开发者 https://www.devze.com 2022-12-28 06:17 出处:网络
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/file开发者_如何学运维1.pdf\" how can I set another string to

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/file开发者_如何学运维1.pdf" how can I set another string to file1.pdf?

Thanks everyone in advance


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


string filename = Path.GetFileName(path);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号