Count words in a sentence

This shows how you could count the amount of words in sentence.

 

<%
'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
%>

which gives you the following

<% '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 %>

Sponsors

247malls.com

Free $100

Try Beeweeb Internet File Server FREE!

Bonus Directory!