I have an array which contains the following results
red red red blue blue Green White Grey
and I want to get duplicate count of every val
a little error above, right code is:
string[] arr = { "red", "red", "blue", "green", "Black", "blue", "red" }; var results = from str in arr let c = arr.Count( m => str.Contains(m.Trim())) select str + " count=" + c; foreach(string str in results.Distinct()) Console.WriteLine(str);