您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> asp编程 >> 正文

asp 特殊字符屏蔽代码

作者:佚名    责任编辑:admin    更新时间:2022-06-22

function strreplace(str)
 if str = "" then
  strreplace = str
 else
  strreplace = replace(str,"'","''")
 end if
end function
检测数字函数
function check_num(str)
   dim i
   For i = 1 To Len(str)
  
     if  Asc(Mid(str, i, 1)) < 48  or   Asc(Mid(str, i, 1)) > 57 then
          check_num=false
    exit function
     else
       check_num=true
     end if
   Next
end function

function cutstr(str,strlen,more,url)
if len(str)>strlen then
  str=left(str,strlen) & "......"
End if
if (len(str)>strlen) and more then
  str=str+"&nbsp;&nbsp;&nbsp;[url="+url+"]点这里查看详情[/url]"
End if
cutstr=str
End function