c# - Query for string containing one or more of many strings -


i found example here:

var foo = things.where(data => mylist.contains(data.title)); 

however exact string matching. interested in if data.title.tolower() contains of strings found in list tolower().

say list has apple, book clock in it.

data.title example: apple jacks, book club, clockwork book, fine. claws , foods, clicks, application fundamentals, not accepted.

you want each item title may contain (ignoring case):

var foo = things.where(data => mylist                 .any(item => data.title.tolower().contains(item.tolower()))); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -