国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > regex > 正文

去除內(nèi)容中的html

2020-01-20 22:31:30
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
<%
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


%>

<form method="post" id=form1 name=form1>
  <b>Enter an HTML String:</b><br>
  <textarea name="txtHTML" cols="50" rows="8" wrap="virtual"><%=Request("txtHTML")%></textarea>
  <p>
  <input type="submit" value="Strip HTML Tags!" id=submit1 name=submit1>
</form>

<% if Len(Request("txtHTML")) > 0 then %>
    <p><hr><p>
    <b><u>View of string <i>with no</i> HTML stripping:</u></b><br>
    <xmp>
    <%=Request("txtHTML")%>
    </xmp><p>
    <b><u>View of string <i>with</i> HTML stripping:</u></b><br>
    <pre>
    <%=StripHTML(Request("txtHTML"))%>
    </pre>
<% End If %>
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 武功县| 天镇县| 东乡族自治县| 唐海县| 汪清县| 南溪县| 林西县| 上栗县| 兰溪市| 白朗县| 门源| 民和| 鄂尔多斯市| 达孜县| 西和县| 安塞县| 洪雅县| 通山县| 泰安市| 东乡| 蓬溪县| 德兴市| 北川| 仙居县| 北京市| 慈利县| 伊春市| 安阳县| 宁陕县| 南川市| 加查县| 秦皇岛市| 旅游| 绩溪县| 双鸭山市| 龙口市| 平安县| 大同县| 东丽区| 奉化市| 奉化市|