C#-截取字符串----ShinePans
2014-04-03 20:17
267 查看
//format的使用 //查询今天的日期 //截取字符串 using System; class program { static void Main() { string strAllPath = "D:\\C# ABCD\\C# abcd.exe"; string strPath = strAllPath.Substring(0, strAllPath.LastIndexOf("\\") + 1); string strName = strAllPath.Substring(strAllPath.LastIndexOf("\\") + 1); Console.WriteLine("文件路径:",strPath); Console.WriteLine("文件名:", strName); Console.ReadLine(); } }
相关文章推荐
- C#利用正则表达式实现字符串搜索---ShinePans
- C#-format-分隔字符串---ShinePans
- C#几个经常用到的字符串的截取
- C#几个经常用到的字符串截取
- c#中字符串截取使用的方法
- C#正则截取URL网址字符串
- C#字符串截取函数Substring
- [转]c#截取指定长度的字符串
- C#字符串截取 和其他函数
- C#截取指定长度中英文字符串方法
- paip.截取字符串byLastDot方法总结uapi python java php c# 总结
- C#截取指定长度中英文字符串方法
- C# 之 字符串截取--Split
- C# 字符串截取
- c#中英文混合字符串截取指定长度
- C# 截取字符串
- 用C#截取指定长度的中英文混合字符串
- c# 截取字符串和分割字符串
- 字符串截取(C#)
- C#截取字符串(String.Substring方法)