samedi 4 janvier 2020

Better design pattern to compare two lists

i need a suggestion for the scenario noted below :

Contents in List A : string name , byte[] ,etc

Contents in List B : string name.

i have two collections and i need to iterate the List A with List B and check in a sequence if name from List B == name from List A .

for this i do a while loop with the sequence lengths and if /else loop for decision making if name matches or not.

is there any better way to avoid loops and if/else?

Aucun commentaire:

Enregistrer un commentaire