求个简单的截取字符串 现在有个字符System.String注:点后面的长度是随机变化的!前面的System.是固定的我要获得.后面的字符,应该怎么截取!谢谢各位大哥帮忙 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str="System.String"string[] array=str.sqlit('.')array[1] 就是你要的 或者直接str.substring(7,str.Length-1); string result = yourstr.SubString(yourStr.IndexOf(".")+1); string result = str.SubString(7); 我知道两种方法:①string a = "system.string";string b = a;b = b.Remove(0,7);②string a = "system.string";string b = a;b = b.Replace("system", ""); string UWantStr=Str.SubString(Str.IndexOf('.')+1); 对,就是这个……string str="System.String.........";string getstr=str.substring(7,str.Length-1);这个getstr就是你要的字符串 string temp=要截取的字符串.substring(?);?表示开始截取的索引位置, 从0开始 string str="System.String";string[] array=str.sqlit('.');array[1] 就是你想要的了 str.substring(str.IndexOf("."),str.Length-str.IndexOf(".")-1); string 结果 = str.SubString( str.IndexOf(".") + 1 ); 最好还是别用split,如果system.后面几项存在'.'这个字符的话,就不能全部获得了 关于WCF服务接口调用 文件拷贝!高手来啊! 百分求助!代理网络环境下的邮件发送问题 求助dataGridView 中使用ComboBox 并且绑定到数据库的每一个字段 在同一个表 源码~~~~~~~~~~~~~~~~~~急! 有没有用过XpTable的大能,有问题求助 C#连接数据库的原理 在winform中,如何让DataGrid中列内容按左对齐? 用StreamReader的ReadToEnd方法读取时,提示"不能为非负数字",怎样在读取前检测是否是负数呢??? 能讲讲什么叫.net技术,该如何学习啊 安装duwamish7.0的失败问题 winform 线程 几个小问题
string[] array=str.sqlit('.')
array[1]
就是你要的
①string a = "system.string";
string b = a;
b = b.Remove(0,7);②string a = "system.string";
string b = a;
b = b.Replace("system", "");
对,就是这个……
string str="System.String.........";
string getstr=str.substring(7,str.Length-1);
这个getstr就是你要的字符串
?表示开始截取的索引位置, 从0开始
string[] array=str.sqlit('.');
array[1] 就是你想要的了