📅  最后修改于: 2022-03-11 14:48:46.611000             🧑  作者: Mango
// The LINQ Where can be used to filter in a collection.
// It will return a Enumerable that contains all of the matching elements
var names = new List() {"John", "Jane", "William"};
//I use ToLower to get any name that contains a J, Capital or not.
var namesWithJ = names.Where(n => n.ToLower().Contains("j"));
//Returns IEnumerable that contains ["John", "Jane"]