Is there any way I can put items in Array
without multiplying them? I'm trying the following. I want to add the items from the MethodList
list in the toAdd
list, but without repeating what is in the sourceItems
list:
For Each iKey As String In MethodList
For Each d As AutocompleteItem In mMenu.Items.sourceItems
If Not (d.Text = iKey) Then ' Verifica se o item não existe na lista
toAdd.Add(New AutocompleteItem(text:=iKey, 7))
End If
Next
Next
But it is not working, so it shows in the toAdd
list:
MeuObjeto
MeuObjeto
MeuObjeto
MeuObjeto
MeuObjeto
....
and repeating them infinitely, I want to make it not have the same object in the list.