国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

轉換字符串帶有http://的超級鏈接字符串為真正的超級鏈接(源碼)

2019-11-18 22:09:03
字體:
來源:轉載
供稿:網友
Code Title: Auto-linking
Description: How would you like to have every instance of an http:// auto-hyperlink itself to the URL
address that follows it? Well, here is a killer little function that will take every one of those that it
finds in a string and sets up the hyperlink for you! Cool, eh?
Copy and paste this snippet as-is into your editor:

-------------------------------------------------------------------------
<%
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&""">"&strLinkText&"</a>"
iCurrentLocation = iLinkEnd
Loop
strOutput = strOutput & Mid(strInput, iCurrentLocation)
LinkURLs = strOutput
End Function
strUnlinked = "http://LINE9.com rules! <br>" & vbCrLf
strUnlinked = strUnlinked & "http://pdxpc.com sells great computers!<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 is the text after it gets automatically hyperlinked to itself:
Response.Write "<b>Text After Linking:</b><br>" & vbCrLf
Response.Write LinkURLs(strUnlinked)
%>
-------------------------------------------------------------------------


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 固安县| 集贤县| 藁城市| 塔河县| 兴义市| 屏山县| 淳安县| 宝兴县| 平凉市| 香河县| 庄浪县| 沁阳市| 登封市| 曲靖市| 陆良县| 九龙县| 高阳县| 黄大仙区| 聊城市| 乾安县| 三台县| 郎溪县| 广南县| 武胜县| 电白县| 永福县| 兴城市| 汝阳县| 铜山县| 广饶县| 阜新| 略阳县| 罗平县| 宁城县| 台南市| 邓州市| 贵港市| 永吉县| 宝清县| 洪雅县| 南阳市|