c# find duplicates in list of strings

C#
var list = new List<string>();

// Fill the list

if(list.Count != list.Distinct().Count())
{
     // Duplicates exist
}var list = new List<string>();
list.GroupBy(n => n).Any(c => c.Count() > 1);
Source

Also in C#: