您的位置:首页 > 编程语言 > ASP

asp:截取文章内容,多出来的以...显示!

2009-07-17 18:06 246 查看
<%function fPlainText(content)
if isNull(content) then exit function
set re1 = New regExp
re1.Global = true
re1.IgnoreCase = true

re1.Pattern = "<.*?>"
content = re1.Replace(content,"")

if len(content)>150 then content=left(content,150)+"......"

re1.Pattern = "/r/n/s*"
content = re1.Replace(content,"<br/>")
set re1=nothing
fPlainText=content
end function
%>
调用代码

<%=fPlainText(wznr)%>
上面那个150 就是你要调出的文字数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: