欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【自动去除字符中含有html代码的几个ASP函数】,下面是详细的分享!
自动去除字符中含有html代码的几个ASP函数
| 以下为引用的内容: Function stripHTML(strHTML) 'Strips the HTML tags from strHTML Dim objRegExp, strOutput Set objRegExp=New Regexp objRegExp.IgnoreCase=True objRegExp.Global=True objRegExp.Pattern="<.+?>" 'Replace all HTML tag matches with the empty string strOutput=objRegExp.Replace(strHTML, "") 'Replace all < and > with < and > strOutput=Replace(strOutput, "<", "<") strOutput=Replace(strOutput, ">", ">") stripHTML=strOutput 'Return the value of strOutput Set objRegExp=Nothing End Function |
| 以下为引用的内容: Public Function Replacehtml(Textstr) Dim Str,re Str=Textstr Set re=new RegExp re.IgnoreCase=True re.Global=True re.Pattern="<(.[^>]*)>" Str=re.Replace(Str, "") Set Re=Nothing Replacehtml=Str End Function |
| 以下为引用的内容: function nohtml(str) dim re Set re=new RegExp re.IgnoreCase=true re.Global=True re.Pattern="(\<.[^\<]*\>)" str=re.replace(str," ") re.Pattern="(\<\/[^\<]*\>)" str=re.replace(str," ") nohtml=str set re=nothing end function |
| 以下为引用的内容: Function stripHTML(strHTML) 'Strips the HTML tags from strHTML Dim objRegExp, strOutput Set objRegExp=New Regexp objRegExp.IgnoreCase=True objRegExp.Global=True objRegExp.Pattern="<.+?>" 'Replace all HTML tag matches with the empty string strOutput=objRegExp.Replace(strHTML, "") 'Replace all < and > with < and > strOutput=Replace(strOutput, "<", "<") strOutput=Replace(strOutput, ">", ">") stripHTML=strOutput 'Return the value of strOutput Set objRegExp=Nothing End Function |
以上所分享的是关于自动去除字符中含有html代码的几个ASP函数,下面是编辑为你推荐的有价值的用户互动:
相关问题:asp 去除字段内的 html代码并截取只显示前100个字符
答:哎.... 1. 把这段代码领存为一个文件,比如叫a.asp放在和你这个页面的同一级目录下 ",">")," >>详细
相关问题:asp网站发布内容时截取前100个字做摘要,同时去除...
答:可以分两步进行: step1:去除HTML Function RemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "]*>" RegEx.Global = True RemoveHTML = RegEx.Replace(strText, "") End Function step2:截取字符串 (这里使用 自定义... >>详细
相关问题:ASP去掉HTML代码
答:ASP去掉HTML代码: 方法一 : 禁用HTML 最简单的方法是直接禁用html标签而不用移除它们. 可以使用Replace()函数. 例如: strText = Replace(strText, " >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
