[Solved] Get Difference of 2 Paths [duplicate]

[ad_1]

If Path actually contains double slashes (which usually doesn’t happen):

  1. Replace \\ with \ in path1

  2. Replace path1 with Empty String in path2

    string diff = path2.Replace(path1.Replace(@"\\", @"\"), "");
    

Otherwise:

string diff = path2.Replace(path1, "");

9

[ad_2]

solved Get Difference of 2 Paths [duplicate]