我有一个名为 capital 的类,其中包含 2 个变量 country 和 capital.Here 它看起来如何......
public class country
{
public string Country { get; set; }
public string Capital { get; set; }
}
我有一个以上类类型的列表,即List<country>
我可以使用国家类变量添加值。现在如何找到包含这些值的列表的特定值
country:USA,
capital:New York
country:China,
capital:Bejing
如何在上面的列表中找到中国……最好的方法是什么?