如果用戶輸入了http://aaa.bbb.ccc
下面這個代碼將把他的輸入轉換成http://aaa.bbb.ccc
大家看看正則表達式有多厲害,呵呵。
? ? '調用這個函數來顯示成超鏈接
? ? Response.Write to_html(s_message)
%>
Function to_html(s_string)
? ? to_html = Replace(s_string, """", """)
? ? to_html = Replace(to_html, " ? ? to_html = Replace(to_html, ">", ">")
? ? to_html = Replace(to_html, vbcrlf, "
")
? ? to_html = Replace(to_html, "/ ? ? to_html = Replace(to_html, "/>", ">")
? ? to_html = edit_hrefs(to_html)
End Function
%>
以上就是轉換文本為超鏈接和電子郵件格式的代碼教程,感謝大家的閱讀,更多內容請關注錯新技術頻道網站。
新聞熱點
疑難解答