asp 过滤非法字符函数
- 程序员文章站
- 2023-09-06 14:15:08
<%
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("中国不阿斗发射点发明")
%>