1 public static string DateFormatString { get; set; }
2 public static string DefaultJson = "{}";

 

1、转义html

 1 /// <summary>
 2 /// 转义html
 3 /// </summary>
 4 /// <param name="htmlStr"></param>
 5 public static string ConvertHtml(string htmlStr)
 6 {
 7 if ((htmlStr + "").Length > 0)
 8 {
 9 return htmlStr.Replace("\\\"", "\"")
10 .Replace("\"", "\\\"")
11 .Replace("\\", "\\\\")
12 .Replace("\r", "<br/>")
13 .Replace("\n", "<br/>")
14 .Replace("\t", "")
15 .Trim();
16 }
17 return "";
18 }
View Code

相关文章:

  • 2021-08-16
  • 2021-06-05
  • 2020-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案