日期:2014-05-17 浏览次数:21011 次
public static string MyStrStr(string test, string head, string end)
{
int a1 = test.IndexOf(head);
int a2 = test.IndexOf(end, a1);
return test.Substring(a1 + head.Length, a2 - a1 - head.Length);
}
//调用
string result = MyStrStr(html, @"前一段", "后面部分");得到中间部分