chris combe

chris combe

  • 1.7k
  • 22
  • 2.4k

List (multidim) : How to check if an item exists in the 2nd column?

Feb 27 2023 5:31 PM
var lst = new List<(int number, string country, string population)> { };

lst.Add((4, "Germany", "83 Millionen"));
lst.Add((3, "USA", "328 Millionen"));
lst.Add((1, "France", "66 Millionen"));
lst.Add((2, "Spain", "46 Millionen"));

Hi,
How do I check if the 2nd column of "lst" contains "France" ? (for example)
lst.Contains( ?
Thanks!!


Answers (3)