Tom's Guide | Tom's Hardware | Tom's Games
By: Radix-64
Want to count the number of times a letter appears in a string using VBScript?
Here's how to do it using the 'split' and 'ubound' functions.
<%
Dim textstring, wipstring, numberoftimes
textString ="The brown fox jumped quickly over a fence"
wipstring = Split(textstring, "a")
numberoftimes = UBound(wipstring)
Response.write "The count is " & numberoftimes & " ."
%>