Private Sub CountWords()
Dim strText As String = "It's a wonderful world"
Dim iCount As Integer
Do While (strText.IndexOf(Space(2)) >= 0)
strText = strText.Replace(Space(2), Space(1))
Loop
iCount = Split(strText, Space(1)).Length
MsgBox(iCount.ToString())
End Sub
用户评论