C# 替换指定的字符串和去除文件的后缀

 

 string m_FilePath =m_FilePath.Replace(@"\","\\");// 单斜杠替换成双斜杠  

string m_FileName = (file.FileName).Substring((file.FileName).LastIndexOf('\\') + 1, (file.FileName).LastIndexOf('.') - (file.FileName).LastIndexOf('\\') - 1); //要去除后缀的字符串

posted @ 2017-09-06 10:02  无止境!  阅读(2568)  评论(0编辑  收藏  举报