/// <summary>
/// 特殊字符过滤
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
private static string String2Json(string s)
{
return s.Replace("'", "'+char(39)+'").Replace("&", "'+char(38)+'");
}

  

其中 char(39)代表英文单引号'  char(38) 代表&  还有一些其它字符需要过滤的话在后面拼接上就好,下面是查询的结果

       

select char(39)
select char(38)

 


 
                    
            
                

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-05-27
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案