/// <summary>
/// 截取中间字符
/// </summary>
/// <param name="text">全字符串</param>
/// <param name="start">开始字符串 </param>
/// <param name="end">结束字符串 </param>
/// <returns></returns>
public string Substring(string text, string start, string end)
{
Regex rg = new Regex("(?<=(" + start + "))[.\\s\\S]*?(?=(" + end + "))", RegexOptions.Multiline | RegexOptions.Singleline);
string NameText = rg.Match(text).Value;
return NameText;
}
转载于:https://www.cnblogs.com/AbelAngelo/p/10911694.html