c# find syntax code example
Example 1: find a value in list of objects in c#
var item = TextPool.FirstOrDefault(o => o.Name == "test");
if (item != null)
item.value = "Value";
Example 2: c# find element by condition
int[] plantHeights = { 3, 6, 4, 1, 6, 8 };
// Find the first occurence of a plant height that is greater
// than 5 inches
int firstHeight = Array.Find(plantHeights, height => height>5);