Convert string with http://hyperlink string for true Hyperlink
Source: Internet
Author: User
link | conversion | string Function linkurls (strinput)
Icurrentlocation = 1
Do While INSTR (Icurrentlocation, strinput, "http://", 1) <> 0
Ilinkstart = InStr (icurrentlocation, strinput, "http://", 1)
Ilinkend = InStr (Ilinkstart, Strinput, "", 1)
If ilinkend = 0 Then ilinkend = Len (strinput) + 1
Select Case Mid (Strinput, iLinkEnd-1, 1)
Case ".", "!", "?"
Ilinkend = iLinkEnd-1
End Select
Stroutput = stroutput & Mid (Strinput, icurrentlocation, ilinkstart-icurrentlocation)
Strlinktext = Mid (Strinput, Ilinkstart, Ilinkend-ilinkstart)
Stroutput = stroutput & "<a href=" "&strLinkText&" "target=" "_blank" ">" &strLinkText& "< /a> "
Icurrentlocation = Ilinkend
Loop
Stroutput = stroutput & Mid (strinput, icurrentlocation)
Linkurls = Stroutput
End Function
Dim strunlinked
strunlinked = "http://www.webjx.com http://www.163.com<br/>" & vbCrLf
' Here is the before text:
Response.Write "<b>original text:</b><br/>" & vbCrLf
Response.Write strunlinked
Response.Write vbCrLf & "<br/>" & vbCrLf & VbCrLf
' Here's the text after it gets automatically hyperlinked to itself:
Response.Write "<b>text after linking:</b><br/>" & vbCrLf
Response.Write Linkurls (strunlinked)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.