去除字符串中所有的超级链接

80酷酷网    80kuku.com

  链接|字符串

以下是函数源代码:
’=========================================================
’** 函数:RemoveHref_A
’** 作用:去除字符串中所有的超级链接 
’** 作者:阿里西西
’** 时间:2005-11-10
’** 网站:http://www.alixixi.com/ 
’=========================================================
Function RemoveHref_A(HTMLstr)
Dim n,str1,str2,str3,str4
HTMLstr = Lcase(HTMLstr)
For n=1 to Ubound(Split(HTMLstr,"<a"))
str1 = Instr(HTMLstr,"<a")
str2 = Instr(str1,HTMLstr,">")
HTMLstr = left(HTMLstr,str1-1)&right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))
HTMLstr = replace (HTMLstr,"</a>","")
RemoveHref_A = HTMLstr
Next
End Function

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: