programming-examples/asp/More_Code_Snippets/Count words in a sentence.asp

10 lines
323 B
Plaintext
Raw Normal View History

2019-11-18 14:25:58 +01:00
<%
'the string to check
strText = "This is our sample text for this example"
'split the strText
arrText = Split(strText ," ")
'store the amount of words into intWords
intWords = Ubound(arrText )
'display how many words are in the sentence
Response.Write "There are " & intWords & " words in " & strText
%>