I'm trying to see how many times the maximum value of an array occurs within the array by using .Count()
with a function inside. However I don't fully understand how to do it. From reading the MSDN's scant example I thought I understood, however apparently not!
This is what I thought of:
string[] test = { "1", "2", "3", "4", "4" };
string max = test.Max();
Label1.Text = test.Count(p => p == max);
But that does not work, so I tried changing max to an int to see if that would work, and it did not either.