csharp use linq path - Ams627/InterestingCode GitHub Wiki
First of all, let’s see how to print the PATH:
private static void PrintPath()
{
// get variable or the empty string if the variable does not exist:
var pathVariable = Environment.GetEnvironmentVariable("path") ?? "";
pathVariable.Split(';').ToList().ForEach(Console.WriteLine);
}