Have a look on following approach:
Using a dictionary with its key for the different lists
dictLists
Dictionary<string, List<string>>(3) { { "Letters", List<string>(5) { "A", "B", "C", "C", "D" } }, { "Greek", List<string>(4) { "Alpha", "Beta", "Gama", "Theta" } }, { "Items", List<string>(3) { "Item1", "Item2", "Item3" } } }
strCheck
"Alpha Bank"
arrMatchKeys = dictLists.Keys.Where(Function (x) dictLists(x).Intersect(strCheck.Split(" "c)).Count > 0).toArray
string[1] { "Greek" }
arrMatchKeys
string[1] { "Greek" }
for sure, The LINQ statement can also be decomposed to essential activities. The approach will work dynamicly over all contained lists within the dictionary and requires no change e.g. when additional lists are added to the dictionary.