日期:2014-05-18  浏览次数:20498 次

字符串 11_2222_88888.abc.efg.ddd如何得到 2222_88888 子字符串.
字符串   11_2222_88888.abc.efg.ddd  

如何得到   2222_88888   子字符串.

------解决方案--------------------
如果有什么规律的话可以使用正则表达式试试:
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:bdbox@hotmail.com
请给我与您交流的机会