最新下载
热门教程
- 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 %>
相关文章
- 守望黎明如何转职业 04-20
- 乱斗西游2怎么抽哪吒 04-20
- 女神异闻录夜幕魅影烧鸟外卖其一怎么攻略 女神异闻录夜幕魅影烧鸟外卖其一攻略方法 04-20
- 碧蓝航线鲤μ兵装获得方法 碧蓝航线鲤μ兵装获得方法 04-20
- 明日方舟BB-EX-5突袭攻略 明日方舟BB-EX-5突袭怎么打 04-20
- 射雕手游金盏罗盘获取位置介绍 射雕手游金盏罗盘怎么获取 04-20