最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
另外一个功能更强大的函数,也是用正则表达式写的,不过加了一些东西
时间:2022-06-30 10:55:09 编辑:袖梨 来源:一聚教程网
<%
Option Explicit
Function stripHTML(strtext)
dim arysplit,i,j, strOutput
arysplit=split(strtext,"<")
if len(arysplit(0))>0 then j=1 else j=0
for i=j to ubound(arysplit)
if instr(arysplit(i),">") then
arysplit(i)=mid(arysplit(i),instr(arysplit(i),">")+1)
else
arysplit(i)="<" & arysplit(i)
end if
next
strOutput = join(arysplit, "")
strOutput = mid(strOutput, 2-j)
strOutput = replace(strOutput,">",">")
strOutput = replace(strOutput,"<","<")
stripHTML = strOutput
End Function
%>
<% if Len(Request("txtHTML")) > 0 then %>
<%=Request("txtHTML")%>
<% End If %>
Option Explicit
Function stripHTML(strtext)
dim arysplit,i,j, strOutput
arysplit=split(strtext,"<")
if len(arysplit(0))>0 then j=1 else j=0
for i=j to ubound(arysplit)
if instr(arysplit(i),">") then
arysplit(i)=mid(arysplit(i),instr(arysplit(i),">")+1)
else
arysplit(i)="<" & arysplit(i)
end if
next
strOutput = join(arysplit, "")
strOutput = mid(strOutput, 2-j)
strOutput = replace(strOutput,">",">")
strOutput = replace(strOutput,"<","<")
stripHTML = strOutput
End Function
%>
<% if Len(Request("txtHTML")) > 0 then %>
View of string with no HTML stripping:
<%=Request("txtHTML")%>
View of string with HTML stripping:
<%=StripHTML(Request("txtHTML"))%>
<% End If %>
相关文章
- 龙魂旅人不同龙毕业龙语有哪些 毕业龙语推荐一览 08-21
- 四海兄弟故乡联机怎么操作 单人模式玩法特色说明 08-21
- 伊瑟弥亚瑟技能是什么 弥亚瑟玩法介绍 08-21
- 龙魂旅人神界币怎么获取 神界币获取方式分享 08-21
- 龙魂旅人幻灵怎么升星 幻灵升星机制介绍 08-21
- 四海兄弟故乡豪华版和标准版有什么区别 豪华版专属内容介绍 08-21