Displaying Source Code(s)
|
|
--------------------------------------------------------------------------------
Count Words
--------------------------------------------------------------------------------
Description : Counts the words in a string
<%
Dim TheString, ArrayTemp, NumberOfWords, Word
TheString = "Hello, How are you today?" 'just a test string
ArrayTemp = Split(TheString, " ")
NumberOfWords = UBound(ArrayTemp) + 1
Response.Write "<P>The String is: " & TheString
Response.Write "<P>Number of words In that string: " &
NumberOfWords
Response.Write "<P>Here are the words which compose that string:
"
For Each Word In ArrayTemp
Response.Write "<BR>" & word
Next
%> |
|
|