标签:
查询条件过滤替换特许符号
public static string SpecialSymbols(string strText) { strText = strText.Trim(); strText = strText.Replace("!", "‘ + char(33) + ‘"); strText = strText.Replace("\"", "‘ + char(34) + ‘"); strText = strText.Replace("$", "‘ + char(36) + ‘"); strText = strText.Replace("%", "‘ + char(37) + ‘"); strText = strText.Replace("&", "‘ + char(37) + ‘"); strText = strText.Replace("‘", "‘ + char(39) + ‘"); strText = strText.Replace("(", "‘ + char(40) + ‘"); strText = strText.Replace(")", "‘ + char(41) + ‘"); strText = strText.Replace("*", "‘ + char(42) + ‘"); strText = strText.Replace("+", "‘ + char(43) + ‘"); strText = strText.Replace(",", "‘ + char(44) + ‘"); strText = strText.Replace("-", "‘ + char(45) + ‘"); strText = strText.Replace(".", "‘ + char(46) + ‘"); strText = strText.Replace("/", "‘ + char(47) + ‘"); strText = strText.Replace("", "‘ + char(47) + ‘"); return strText; }
标签:
原文地址:http://my.oschina.net/TOW/blog/372012