Searching a Very Long String - Efficiently (Classic ASP)

When it comes to string handling, ASP isn't the most efficient. The easiest code to write is simply instr(1,ucase(search),ucase(find)), and then check the result for > 0. The problem comes with extremely long strings. I needed to search a very long string of values from each line of CSV. It was actually much faster to split each line into its individual elements and search one cell at a time. Here is the code.

Function CheckSearchString(sToCheck,sList)

	Dim aItems
	Dim bFound
	Dim i
	bFound = False
	aItems = Split(sList, ",")
	For i = lBound(aItems) to uBound(aItems)
		If instr(1,ucase(sToCheck),uCase(aItems(i))) > 0 Then 
			bFound  = true
			Exit For
		'	Response.Write sToCheck
		End If
	CheckSearchString = bFound

End Function


Joe is a User Experience Engineer, Front End Specialist and Application Developer for Bridgeway Software, Inc and part-time consultant for NGO and non-profit organizations in the Houston area. Joe is also a part-time Portrait Photographer at and organizer of the photography club. He and his wife Marty run the Support and Playdate group.













Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /home/content/e/x/t/ext237/html/modules/ctools/includes/ on line 52