1、先处理中间空格
Dim str As String = " 1 2 3"str = System.Text.RegularExpressions.Regex.Replace(str, " +", " ")str = str.Trimmsgbox(str)
2、处理有多少个空格
Dim str As String = "1 2 3"
msgbox(str.split(" ").length)