浏览主站 | 站长工具 | 新闻资讯 | 站长学院 | 站长盈利 | HTML教程 | 网址导航 | 站长周刊 | 会员投稿 | 滚动新闻 | RSS
发新话题
打印

去除html标志

去除html标志

[[wiki]wiki[/wiki]][/wiki]<%
Function show_string(in_string,out_count)
  dim first_show(2)  '定义判断关键字符的上下标记
  dim last_str
  last_str=in_string
if Instr(last_str,">")>0 then       '判断是否含有html代码
  do while len(show_str)<out_count and last_str<>""
     first_show(0)=Instr(last_str,"<")
      if first_show(0)<>1 then
         first_show(1)=Instr(last_str,">")   '取下个>的位置
             '*********************************************************
               if len(last_str)>first_show(0) and last_str<>"" and first_show(0)>1 then '判断下标是否越界,如没有越界
                   show_str=show_str&left(last_str,first_show(0)-1)
               else
                   show_str=show_str&last_str
               end if
             '**********************************************************
             '******************判断下标是否越界*******************
               if len(last_str)>first_show(1) then
                  last_str=right(last_str,len(last_str)-first_show(1))
               else
                  last_str=""
               end if
            '******************************************************
     else
            last_str=right(last_str,len(last_str)-Instr(last_str,">"))
     end if
  loop
else
show_str=in_string
end if
show_str=left(show_str,out_count)
show_string=show_str
end function
%>

TOP

发新话题