Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #list
ADD COMMENT
Topic
Name
5+8 =