国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 闽清县| 嘉兴市| 广灵县| 梅州市| 大足县| 富宁县| 河池市| 巩留县| 云梦县| 邓州市| 罗山县| 潮州市| 泸溪县| 襄城县| 西乌珠穆沁旗| 务川| 威信县| 瑞金市| 东乌珠穆沁旗| 沧源| 边坝县| 乌拉特后旗| 怀安县| 东至县| 增城市| 秭归县| 永德县| 梓潼县| 武邑县| 富平县| 福贡县| 龙口市| 大悟县| 河东区| 镇安县| 闻喜县| 芜湖市| 乳山市| 蒲江县| 新龙县| 镇巴县|