For brevity\'s sake in my code, i\'d like to be able to do the following: having a collection, find the first element matching a lambda expression; if it exists, return the valu
Why not just do:
stuff.Where(s => s.contains("bvi")) .Select(s => s.ToUpper()) .FirstOrDefault()
If you have a "non-default default", you can do:
stuff.Where(s => s.contains("bvi")) .Select(s => s.ToUpper()) .DefaultIfEmpty("Something Else") .First()