看看这个,行否? Private Sub Command1_Click() Dim str As String Dim str1 As String Dim i As Integer str = "abc d ef gmn" For i = 1 To Len(str) If Mid(str, i, 1) <> "." Then str1 = str1 + Mid(str, i, 1) End If Next i Label1.Caption = str1 End Sub
'或者这样, Dim strA As String Dim i As Integer strA = "..4645564..13.034324.5." For i = 1 To Len(strA) i = InStr(strA, ".") If i = 0 Then Exit For strA = Left(strA, i - 1) & Right(strA, Len(strA) - i) Next i
Private Sub Command1_Click()
Dim str As String
Dim str1 As String
Dim i As Integer
str = "abc d ef gmn"
For i = 1 To Len(str)
If Mid(str, i, 1) <> "." Then
str1 = str1 + Mid(str, i, 1)
End If
Next i
Label1.Caption = str1
End Sub
'这样好用啊
Dim strA As String
Dim i As Integer
strA = "..4645564..13.034324.5."
For i = 1 To Len(strA)
i = InStr(strA, ".")
If i = 0 Then Exit For
strA = Left(strA, i - 1) & Right(strA, Len(strA) - i)
Next i