<%
'去除HTML代码,去除空格,
'主要用在从内容中显示前面50个字
function nohtml(str)
dim re
'str=replace(replace(str,"<br>",vbcrlf),"<BR>",vbcrlf)'就是把它换成vbscript的换行就行了
str=Replace(str," ","")
str=Replace(str," ","")
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 myLeft(str)
myLeft = " "+left(Trim(nohtml(str)),50)
end function
%>
************说明***********
在需要的时方调用myLeft(str)就行了