Codefixer - ASP tutorials, resources and software
ASP.NET Hosting with US & UK Data Centers!
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Monday 6 October
MembersPro PayPal - ASP Membership software

New MS SQL 2008 Available – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

Counting the number of occurences of a substring within a string using the Split and UBound functions

If you are unfamiliar with the Split and UBound functions you may want to read our tutorial on array functions

<%
Dim myString, tempString, iHowManyTimes
myString ="This is a test"
tempString = Split(myString, "is")
iHowManyTimes = UBound(tempString)
Response.write "There are " & iHowManyTimes & " occurences."
%>

Output: There are 2 occurences.








If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site.




Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software