Answers for "contains in object list c#"

C#
3

check if list of objects contains value c#

bool contains = pricePublicList.Any(p => p.Size == 200);
Posted by: Guest on March-04-2020
0

c# string contains any of list

//linq
bool b = listOfStrings.Any(s=>myString.Contains(s));
//shorter but less clear
bool b = listOfStrings.Any(myString.Contains);
Posted by: Guest on July-06-2021

C# Answers by Framework

Browse Popular Code Answers by Language