欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

asp 过滤非法字符函数

程序员文章站 2023-09-06 14:15:08
<% 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("中国不阿斗发射点发明")
%>