var path1 = "C:/Program Files/";
var path2 = "Utilities/SystemUtilities";
ShowPathInformation(path1, path2);
path2 = "/Program Files";
ShowPathInformation(path1, path2);
path1 = "C:/Users/Public/Documents/";
path2 = "C:/Users/User1/Documents/Financial/";
ShowPathInformation(path1, path2);
private static void ShowPathInformation(string path1, string path2)
Console.WriteLine($"Concatenating '{path1}' and '{path2}'");
Console.WriteLine($" Path.Join: '{Path.Join(path1, path2)}'");
Console.WriteLine($" Path.Combine: '{Path.Combine(path1, path2)}'");