1 /// <summary>
 2 /// 获得字符串中开始和结束字符串中间得值
 3 /// </summary>
 4 /// <param name="str">字符串</param>
 5 /// <param name="s">开始</param>
 6 /// <param name="e">结束</param>
 7 /// <returns></returns> 
 8 public static string GetValue(string str, string s, string e)
 9 {
10 Regex rg = new Regex("(?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOptions.Singleline);
11 return rg.Match(str).Value;
12 }

 

相关文章:

  • 2021-07-27
  • 2022-12-23
  • 2022-02-07
  • 2021-11-13
  • 2022-01-03
猜你喜欢
  • 2021-06-30
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案