C#截取字符串用split

.Net技术 码拜 8年前 (2016-05-19) 1287次浏览
“C:\Users\Administrator\Desktop\Jinglun255-12.zip”为字符串
高手能不能帮本人截出C:\Users\Administrator\Desktop
解决方案

20

string path = “C:\Users\Administrator\Desktop\Jinglun255-12.zip”;
path = path.Substring(0, path.LastIndexOf(“\”));

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明C#截取字符串用split
喜欢 (0)
[1034331897@qq.com]
分享 (0)