If Path actually contains double slashes (which usually doesn’t happen):
-
Replace
\\with\inpath1 -
Replace
path1withEmpty Stringinpath2string diff = path2.Replace(path1.Replace(@"\\", @"\"), "");
Otherwise:
string diff = path2.Replace(path1, "");
9
solved Get Difference of 2 Paths [duplicate]