I need to get the full path from directories but use an array to exclude certain paths without entering the full path into the array.
I am getting the path of directories like this:
List<string> dirs = di.GetDirectories("vault*", SearchOption.AllDirectories)
.Select(x => x.FullName).ToList();
The directory looks like this: I need to filter based on the parent after C.
C:\A\vault
C:\B\vault
C:\C\vault
I have an array like this:
string[] exclude = new string[] {"A", "B"};
Doing something like below does not work because it will require I enter the full name of the path to exclude in the array, which can get nasty:
dirs.Except(exclude);
How can I do this better so that I can easily update the array without all the extraneous characters of longer paths? Example: Adding an additional path in the future to exclude.