去掉函数参数中的HTML标记
<%
''*******************************************************************************
''************函数功能:去掉函数参数中的HTML标记*********************************
''*******************************************************************************
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
''*******************************************************************************
''**应用方法:StripHTML("string"),其中,string为要去掉HTML标记的字符串**********
''*******************************************************************************
%>
<%
''*******************************************************************************
''************函数功能:去掉函数参数中的HTML标记*********************************
''*******************************************************************************
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
''*******************************************************************************
''**应用方法:StripHTML("string"),其中,string为要去掉HTML标记的字符串**********
''*******************************************************************************
%>
''*******************************************************************************
''************函数功能:去掉函数参数中的HTML标记*********************************
''*******************************************************************************
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
''*******************************************************************************
''**应用方法:StripHTML("string"),其中,string为要去掉HTML标记的字符串**********
''*******************************************************************************
%>
<%
''*******************************************************************************
''************函数功能:去掉函数参数中的HTML标记*********************************
''*******************************************************************************
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
''*******************************************************************************
''**应用方法:StripHTML("string"),其中,string为要去掉HTML标记的字符串**********
''*******************************************************************************
%>
浙公网安备 33010602011771号