取值问题,在线等急!等

snow_white 2009-08-10 09:48:40
在ASP中:
有字符为:<span style='color;spanda'>你</span>,请问哪位高手能写个函数截取这个字符
得到结果为‘你’呢?
谢谢!
...全文
45 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
mailbao 2009-08-10
  • 打赏
  • 举报
回复
学习高人的方法
hookee 2009-08-10
  • 打赏
  • 举报
回复


s = "<span style='color;spanda'>你</span>"
Reponse.Write stripHTML(s)

Function stripHTML(strHTML)
'Strips the HTML tags from strHTML

Dim objRegExp, strOutput
Set objRegExp = New Regexp

objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|\n)+?>"

'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

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧