Count words in a String
Count words in a String
Rate Count words in a String
(2(2 Vote))
'------------------------------------------------------
'Author: Fabian Holzer ([email protected])
'Example: iWordsIn = CountWordsIn("Hallo Welt")
'------------------------------------------------------
Dim i As Integer
For i = 1 To Len(sText)
If Mid$(sText, i, 1) = " " Then
CountWordsIn = CountWordsIn + 1
End If
Next
If sText = "" Then
CountWordsIn = 0
Else
CountWordsIn = CountWordsIn + 1
End If
End Function
Count words in a String Comments
No comments yet — be the first to post one!
Post a Comment