C#中的string查找字符 string path =@"C:\hello\yinyue.mp3";string name = Path.GetFileName(path); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不必使用查找截串,就使用 Path.GetFileName就可以得到文件名称了。代码如上。 string strpath = "C:\hello\yinyue.mp3";int posInt=strPath.LastIndexOf("\"); //最后一个\的位置string strName=strPath.Substring(posInt+1); //这个就是名字了 FileInfo info = new info(FileName);string name = info.Name FileInfo info = new FileInfo(FileName); string name = info.Name 请教正则表达式的问题,以及如何设置网站为可以从URL传参数 问问各位:我平均一天只能敲400行代码,我的效率高吗? 以smallint类字段为条件查询出错 C#中整型数据高低位转换问题!(续之前已解决的问题) 如何在关机前调用自编写WINDOWS服务程序 易语言做的外壳不能连接网关...在线等 请问,深圳的C#行情怎么样啊? 报表的问题,在线等待 怎样相加DataTable 要建立几个函数给几个类公用,这些函数要放在哪里 谁有Code Library for .NET 15.9的注册码 很不错的C#学习资料
int posInt=strPath.LastIndexOf("\"); //最后一个\的位置
string strName=strPath.Substring(posInt+1); //这个就是名字了
string name = info.Name
string name = info.Name