今天才發現這個函數的作用,原來可以查找特定的字符或者字符串。
下面是我寫的簡單例子:
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <% Response.CodePage=65001%>
- <% Response.Charset="UTF-8" %>
- <%
- dim content_text,searchword_text
- 'content是內容,searchword是要搜索的文字
- sub search(content,searchword)
- if InStr(content,searchword) > 0 then
- Response.Write("找到")
- Else
- Response.Write("沒有找到")
- End if
- end sub
- content_text = "搜索吧收集的代碼和教程為阿會楠平時學習收集,網站的目標是方便自己的同時方便大家,本網站系統采用阿會楠自己寫的系統,系統已經寫了半年時間,主要時間放在程序的優化上,程序一直都在更新,歡迎大家加入Q群一起討論學習。"
- searchword_text = "搜索吧"
- call search(content_text,searchword_text)
- %>