+ -
当前位置:首页 → 问答吧 → 怎样去除特定的地址,或超级链接

怎样去除特定的地址,或超级链接

时间:2011-10-30

来源:互联网

'====================================
'** 函数:moveHref  
'** 作用:去除字符串中所有的超级链接  
'====================================
Public Function moveHref (HTMLstr)  
Dim n,str1,str2,str3,str4,tmpstr
tmpstr = HTMLstr
For n=1 to Ubound(Split(HTMLstr,"<area"))  
str1 = Instr(HTMLstr,"<area")  
str2 = Instr(str1,HTMLstr,">")  
HTMLstr = left(HTMLstr,str1-1)&right(HTMLstr,len(HTMLstr)-len(left(HTMLstr,str2)))  
HTMLstr = replace (HTMLstr,"</a>","")  
tmpstr = HTMLstr  
Next 
moveHref = tmpstr
End Function 

怎么样用这个函数除特定的超级链接,这个结果是一串HTML语言,想用它去掉接特定的链接,如:去除含有http://163.com的地址.

作者: sunskyfan   发布时间: 2011-10-30

那就简单多了,2条语句:
HTMLstr = replace (HTMLstr,"http://163.com","")  
HTMLstr = replace (HTMLstr,"</a>","") 

给分吧

作者: phuai007   发布时间: 2011-10-30

简单的就按照一楼说的那样就好了,
但是还有其他的方法!

作者: wu8022   发布时间: 2011-10-30