Answers for "list contains in c#"

1

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
0

list contains type c#

if (within.OfType<Ball>().Any())
Posted by: Guest on June-24-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language