注:文中圆括号成对出现,圆括号内不会再套圆括号。
程序运行界面如图所示。
Private Sub Command1_Click()
Dim s As String, rs As String, c As String, i As Integer, flag As Boolean
s= Text1. Text: rs =“”: flag False
For i=1 To Len (s)
c=Mid(s, i, 1)
IfThen
rs=rs +c
ElseIf c=“(”Them
ElseIf c=“)”Then
flag =False
End If
Next i
Text2 Text=rs
End Sub