I have a list of folders in which I contain a list of languages that I want to be processed:
eng_US
spa_ES
etc...
I have a list of directories containing subfolders for each language it has. They can be more than the ones defined in my languages list. It can look like this:
ja-JP
eng_US
spa_Es
fr_FR
I list the directories in that specific folder like this:
string[] directories = Directory.GetDirectories(path);
I want to get with Linq all that folders that are inside my private language list.
I tried something similar to this:
string[] directories = Directory.GetDirectories(path).Where(x => x.Contains(languageList.Value));
But, obviously is bad :(
How can I get only the folders which are also listed in my private language list?
So, how can I check if my resulting path is contained inside another string list with Linq?
Thanks!
NOTE: My language list is saved in a Dictionary.
IDictionary<int, string> languages;