📜  来自列表 c# 代码示例的 linq

📅  最后修改于: 2022-03-11 14:48:53.242000             🧑  作者: Mango

代码示例1
// Single
string search = "testSearch";
 List list = new List(); // Need to create a string list 
 string result = list.Single(s => s == search);

// Find all where meets the criteria
IEnumerable results = list.Where(s => s == search);
// Select first one
string result = list.First(s => s == search);