Answers for "c# string contains any of list"

C#
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

Code answers related to "c# string contains any of list"

C# Answers by Framework

Browse Popular Code Answers by Language