Answer the question
In order to leave comments, you need to log in
C# how to compare two Lists?
There is a list1
Format: hash (32 characters) = File name
Example 8c75d84d6650219ec65f664b5cd8221b = DbRef.dll
There is a list2
Format: hash (32 characters)
Example 5139da6f02b10595c44460496a50552a It is
necessary to compare hashes and if they match, execute
Console.Write(Display file name);
Preferably a ready-made example, many thanks in advance !!! :)
Answer the question
In order to leave comments, you need to log in
foreach (var item in list1.Where(item => list2.Contains(item.Substring(0, 32))))
{
// Console.WriteLine(item);
}
Идем циклом по первому списку, находимым совпадения циклом по второму. Два цикла, один вложенный.
Это в лоб. Еще можно создать из одного списка словарь, поиск возможно будет быстрее и т.д.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question