字符串 11_2222_88888.abc.efg.ddd如何得到 2222_88888 子字符串. 字符串 11_2222_88888.abc.efg.ddd 如何得到 2222_88888 子字符串. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str = "11_2222_88888.abc.efg.ddd";str = str.SubString(3,13); 如果有什么规律的话可以使用正则表达式试试: string sourceString = @"11_2222_88888.abc.efg.ddd "; string pattern = @"[^\.]*"; System.Text.RegularExpressions.Match result = Regex.Match(sourceString,pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase); if (result.Success) { //提示正确信息 //WL("正确:" + result.Groups[1].Value);//输出 WL("正确:" + result.Value);//输出 } -------------------------------------------MSN:[email protected] 请给我与您交流的机会 11_2222_88888.abc.efg.ddd长度不固定的 用indexof找出_出现的位置,然后从那个位置+1开始substring... asp.net该怎么学 求高手们帮忙,留言板注册用户时的提交按钮 今天理顺了下网站、bs和cs的关系 不想让页面提交该怎么办? 导入Excel时如果应对上下格式不一致的情况 为什么循环只执行了一遍? 打开别人做好地项目文件出错 多文件下载问题? 求助!!IIS中预览出现未能加载“Interop.MSXML2” 怎样在WEB 下的LISTBOX中加入两列,其中一列。。。。。 何如用gridview绑定datalist在两个页面上显示新闻? 请教个【低级】问题,在线等,急!!!!!!!
str = str.SubString(3,13);
string sourceString = @"11_2222_88888.abc.efg.ddd ";
string pattern = @"[^\.]*";
System.Text.RegularExpressions.Match result = Regex.Match(sourceString,pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase);
if (result.Success)
{
//提示正确信息
//WL("正确:" + result.Groups[1].Value);//输出
WL("正确:" + result.Value);//输出
}
-------------------------------------------
MSN:[email protected]
请给我与您交流的机会
长度不固定的