asp 过滤非法字符函数
程序员文章站
2022-05-31 12:44:22
<% function cutbadchar(str) badstr="不|文|明|字|符|列|表|格|式" badword=split(badstr,"|") fo...
<%
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("中国不阿斗发射点发明")
%>