⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 char.asp

📁 1.二级分类 2.前台全部页面生成html
💻 ASP
字号:
<%
function filtestr(str) '去掉字符串的双引号和&,@,等
str=replace(str,"""","")
str=replace(str,"“","")
str=replace(str,"”","")
str=replace(str,"‘","")
str=replace(str,"’","")
'str=replace(str,"'","") '单引号
str=replace(str,"&","")
str=replace(str,"@","")
filtestr=str
end function

function htmltocode(str) '转换html代码
if not isnull(str) then
    str=replace(str, ">", "&gt;")
    str=replace(str, "<", "&lt;")
    str=replace(str, chr(32), "&nbsp;")
    str=replace(str, chr(9), "&nbsp;")
    str=replace(str, chr(34), "&quot;")
    str=replace(str, chr(39), "&#39;")
    str=replace(str, chr(13), "")
    str=replace(str, chr(10) & chr(10), "</p><p> ")
    str=replace(str, chr(10), "<br> ")
    htmltocode=str
end if
end function

function codetohtml(str) '还原html代码
if not isnull(str) then
    str=replace(str, "&gt;", ">")
    str=replace(str, "&lt;", "<")
    str=replace(str,  "&nbsp;"," ")
    str=replace(str, "&quot;", chr(34))
    str=replace(str, "&#39;", chr(39))
    str=replace(str, "</p><p> ",chr(10) & chr(10))
    str=replace(str, "<br> ", chr(10))
    codetohtml=str
end if
end function

function leftchar(str,charnum) '//截取字符串
charnum=int(charnum)
if charnum=0 then
leftchar=str
else
if getlen(str)>charnum then
leftchar=left(str,0.5*charnum)&"..."
else
leftchar=str
end if
end if
end function

function getlen(str) '//计算字符串长度,汉字一个算两个
  if trim(str)="" or isnull(str) then 
   getlen=0
  else
   dim p_len,x
   p_len=0
   getlen=0
   p_len=len(trim(str))
   for x=1 to p_len
    if asc(mid(str,x,1))<0 then
     getlen=int(getlen) + 2
    else
     getlen=int(getlen) + 1
    end if
   next
  end if
 end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -