Dim s As String s = "a b cd e sd sf " s = Replace(s, " ", "") MsgBox s
debug.print replace("Hello world"," ","")
replace("CIUDAD DEL CARM"," ","")
Dim i As Integer Dim tmpstr As String Dim s As String dim mStr as string mStr="CIUDAD DEL CARM" tmpstr = "" For i = 1 To Len(mStr) s = Mid(mStr, i, 1) If s <> " " Then tmpstr = tmpstr & s End If Next i mStr=tmpstr msgbox mStr
Text2.Text = Replace(Text1.Text, " ", "")来的 就给分
s = "a b cd e sd sf "
s = Replace(s, " ", "")
MsgBox s
Dim tmpstr As String
Dim s As String
dim mStr as string
mStr="CIUDAD DEL CARM"
tmpstr = ""
For i = 1 To Len(mStr)
s = Mid(mStr, i, 1)
If s <> " " Then
tmpstr = tmpstr & s
End If
Next i
mStr=tmpstr
msgbox mStr