Function Linkle(strInput)
Dim iCurrentLocation string
Dim iLinkStart
Dim iLinkEnd
Dim strLinkText
Dim strOutput
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>"
'Response.Write iLinkStart & "," & iLinkEnd & "<BR>" & vbCrLf
iCurrentLocation = iLinkEnd
Loop
strOutput = strOutput & Mid(strInput, iCurrentLocation)
linkle = strOutput
End Function
%>
Örneğin veritabanında bulunan bir yazıyı
<%=Linkle(kayizdizesi("yazi"))%>
ile otomatik olarak link yapabilirsiniz.