asp 过滤非法字符函数
(编辑:jimmy 日期: 2024/11/9 浏览:3 次 )
<%
Function cutbadchar(str)
badstr="不|文|明|字|符|列|表|格|式"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(str,badword(i),"***")
End If
Next
cutbadchar=str
End Function
Response.Write cutbadchar("中国不阿斗发射点发明")
%>
Function cutbadchar(str)
badstr="不|文|明|字|符|列|表|格|式"
badword=split(badstr,"|")
For i=0 to Ubound(badword)
If instr(str,badword(i)) > 0 then
str=Replace(str,badword(i),"***")
End If
Next
cutbadchar=str
End Function
Response.Write cutbadchar("中国不阿斗发射点发明")
%>
下一篇:asp 去掉html中的table正则代码函数