Private Sub Command1_Click() Dim Temp As String, N() As String, i As Integer, j As Integer, Tstr As String Temp = Text1.Text N = Split(Temp, ",") '以逗号为分割标致,读取TEXT1中的字符 For i = LBound(N) To UBound(N) - 1 Tstr = N(i) For j = LBound(N) + 1 To UBound(N) If Tstr = N(j) Then Label1.Caption = N(j) Exit Sub End If Next Next
End Sub
Private Sub Command1_Click() Dim Temp As String, N() As String, N_1() As String, i As Integer, j As Integer, k As Integer, Tstr As String Dim IsSample As Integer, IsSample1 As BooleanLabel2.Caption = "" Temp = Text1.Text N = Split(Temp, ",") '以逗号为分割标致,读取TEXT1中的字符 For i = LBound(N) To UBound(N) Tstr = N(i) IsSample = 0 'Label2.Caption = Label2.Caption & N(i) For j = LBound(N) To UBound(N) If Tstr = N(j) Then IsSample = IsSample + 1 'Exit For End If Next If IsSample > 1 Then N_1 = Split(Label2.Caption, ",") IsSample1 = False For k = LBound(N_1) To UBound(N_1) If N(i) = N_1(k) Then IsSample1 = True 'Exit For End If Next If IsSample1 = False Then Label2.Caption = Label2.Caption & "," & N(i) End If End If
Dim Temp As String, N() As String, i As Integer, j As Integer, Tstr As String
Temp = Text1.Text
N = Split(Temp, ",") '以逗号为分割标致,读取TEXT1中的字符
For i = LBound(N) To UBound(N) - 1
Tstr = N(i)
For j = LBound(N) + 1 To UBound(N)
If Tstr = N(j) Then
Label1.Caption = N(j)
Exit Sub
End If
Next
Next
End Sub
Dim Temp As String, N() As String, N_1() As String, i As Integer, j As Integer, k As Integer, Tstr As String
Dim IsSample As Integer, IsSample1 As BooleanLabel2.Caption = ""
Temp = Text1.Text
N = Split(Temp, ",") '以逗号为分割标致,读取TEXT1中的字符
For i = LBound(N) To UBound(N)
Tstr = N(i)
IsSample = 0
'Label2.Caption = Label2.Caption & N(i)
For j = LBound(N) To UBound(N)
If Tstr = N(j) Then
IsSample = IsSample + 1
'Exit For
End If
Next
If IsSample > 1 Then
N_1 = Split(Label2.Caption, ",")
IsSample1 = False
For k = LBound(N_1) To UBound(N_1)
If N(i) = N_1(k) Then
IsSample1 = True
'Exit For
End If
Next
If IsSample1 = False Then
Label2.Caption = Label2.Caption & "," & N(i)
End If
End If