好久没有写博客了
最近项目中涉及到敏感词过来,一点那敏感词中加入特殊字符或者空格则能通过验证,所以写了一个验证过滤特殊字符串
string[] aryReg = { "'", "'delete", "?", "<", ">","%", "\"\"", ",", ".", ">=", "=<", "_", ";", "||", "[", "]", "&", "/", "-", "|", " ", "''" };
for (int i = 0; i < aryReg.Length; i++)
{
Reg= Reg.Replace(aryReg[i], string.empty);
}
Reg=Reg.Replace(" ","");
转载于:https://blog.51cto.com/3847067/1250806