Advertisement
ASP_Volume3 Debugging and Error Handling #53268

Counting number of words in a string

This is a simple and easy way for counting the number of words in a string.

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
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

Upload
Commenti originali (3)
Recuperato da Wayback Machine