Private Sub Command1_Click()
Dim Arr() As String
Dim i As Long
Dim Str As String
Dim MyArr() As String
Str = Text1.Text
Str = Replace(Str, "+", "_")
Str = Replace(Str, "-", "_")
Str = Replace(Str, "*", "_")
Str = Replace(Str, "/", "_")
Str = Replace(Str, "\", "_")
Str = Replace(Str, "^", "_")
Str = Replace(Str, "(", "_")
Str = Replace(Str, ")", "_")
Str = Replace(Str, "[", "_")
Str = Replace(Str, "]", "_")
Debug.Print Str
Arr = Split(Str, "_")
For i = LBound(Arr) To UBound(Arr)
If Len(Arr(i)) > 0 Then
If CLng(Arr(i)) >= 0 Then
ReDim Preserve MyArr(1, i) As String
MyArr(1, i) = Arr(i)
End If
If CLng(Arr(i)) < 0 Then
ReDim Preserve MyArr(-i, -1) As String
MyArr(i, -1) = Arr(i)
End If
End If
Next
End Sub
=======================
大概是这样的,也没法测试,我有点事,你自己看看吧!