Search for text in a string

This searches for some text in a string and returns the location of the first letter of the text searched for in the string.

Code:

<%
Dim strText
'here is our string
strText = "This is our sample text to be searched"
'we will look for the word sample
strSearch = InStr(strText , "sample")
'display the results
Response.Write strSearch
%>

 

Sponsors