To expand Jan's answer, you can create an extension method for the string
class (or the Path
class if you want), for example:
namespace ExtensionMethods { public static class MyExtensions { public static string GetPartialPath(this string fullPath, string partialPath) { return fullPath.Substring(partialPath.Length) } } }
And then use:
using ExtensionMethods; string resultingPath = string.GetPartialPath(partialPath);
I have not tested that this extension method works, but should do .
source share