When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
InStr(str, SearchForStr) : Returns the location a character (charSearchFor)
                           was found in the string str

// InStr function written by: Steve Bamelis - steve.bamelis@pandora.be

function InStr(strSearch, charSearchFor)
InStr(strSearch, charSearchFor) : Returns the first location a substring (SearchForStr)
                           was found in the string str.  (If the character is not
                           found, -1 is returned.)
Requires use of:
	Mid function
	Len function
	for (i=0; i < Len(strSearch); i++)
	    if (charSearchFor == Mid(strSearch, i, 1))
			return i;
	return -1;

ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article