扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:builder.com.cn 2007年4月5日
关键字:
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
濡傛灉鎮ㄩ潪甯歌揩鍒囩殑鎯充簡瑙T棰嗗煙鏈€鏂颁骇鍝佷笌鎶€鏈俊鎭紝閭d箞璁㈤槄鑷抽《缃戞妧鏈偖浠跺皢鏄偍鐨勬渶浣抽€斿緞涔嬩竴銆�