Dim val1 As New List(Of Integer) Dim val2 As New List(Of Integer) Dim val3 As Integer Dim s1 As String = "" Dim s2 As String
For i As Integer = 0 To 999 val1.add(rand.Next(100,999)) val2.add(rand.Next(10000,99999)) Next For i As Integer = 0 To 999 val3 = cint(cstr(val2(i)).SubString(1,3)) If val1.Contains(val3) Then s2=s2 & val2(i) & "," & val3 & " " End If Next