I have an array:
string myArray={"15","56","17-75","78","100-150","130"}
I want to filter myList by arrayElements.
I want equivalent to code below, but programmatically:
mylist.Where(i=>i.val==15 || i.val==56 || (i.val >= 17 && i.val<75) ||i.val==78 || (i.val >= 100 && i.val<150)|| i.val==130)
First convert the strings to something that is more efficient to compare things to:
Then you can compare the items in the list to the values: