
October 3rd, 2000, 12:19 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Taking hyperlink tags out of a string of text???
<i><b>Originally posted by : kyoung (k_young2000@hotmail.com)</b></i><br />I am trying to remove the HTML hyperlink tags out of a string of text from a DB. The functions below are able to remove it as long as there is only one link, if there are more than one, it only removes the last one???<br /><br />Function unLink(strInput)<br /><br />Dim iCurrentLocation<br />Dim iLinkStart<br />Dim iLinkEnd<br />Dim iBetween<br />Dim strOutput<br /><br />iCurrentLocation = 1<br /><br />Do While Instr(iCurrentLocation, strInput, "<a href=", 1) <> 0<br /><br /> iLinkStart = Instr(iCurrentLocation,strInput,"<a href=", 1)<br /> iLinkEnd = Instr(iLinkStart,strInput,">",1)<br /> iBetween = (iLinkEnd + 1 - iLinkStart)<br /> <br /> <br /> strLink = Mid(strInput,iLinkStart,iBetween)<br /><br /> strOutput = Replace(strInput, strLink, "")<br /> <br /> iCurrentLocation = iLinkEnd<br /> <br /> <br />Loop<br /> <br /> unLink = strOutput<br /><br />End Function <br /><br />FUNCTION endLink (strText)<br /> endLink = Replace (strText, "</a>","")<br />END FUNCTION<br /><br /><br />Any help would be much appreciated :-)<br />
|