/// <summary> /// 截取中间字符 /// </summary> /// <param name="text">全字符串</param> /// <param name="start">开始字符串 </param> /// <param name="end">结束字符串 </param> /// <returns></returns> public static string Substring(string text,string start,string end) { Regex regex = new Regex("(?<=(" + start + "))[.\\s\\S]*?(?=(" + end + "))", RegexOptions.Multiline | RegexOptions.Singleline); return regex.Match(text).Value; }
原文地址:https://www.cnblogs.com/Wonderful-Life/p/9831483.html
时间: 2024-10-09 11:56:55