从目标字符串中截取第二个匹配的字符段

namespace ConsoleApplication23
{
class Program
{
static void Main(string[] args)
{

string n = "asfnsjasnbdkasngowrmlaswnlofienm";

int a = n.IndexOf("as");
int b = n.IndexOf("as",(a+1));
string c = n.Substring(b,2);
Console.Write(a);
Console.Write(b);
Console.Write(c);
Console.ReadLine();
}
}
}

posted @ 2016-04-04 20:50  尤痴武  阅读(1253)  评论(0编辑  收藏  举报