Get Relative Path(String, String) Method
Returns a relative path from one path to another.
public: static System::String ^ GetRelativePath(System::String ^ relativeTo, System::String ^ path);
public static string GetRelativePath (string relativeTo, string path);
static member GetRelativePath : string * string -> string
Public Shared Function GetRelativePath (relativeTo As String, path As String) As String
The source path the result should be relative to. This path is always considered to be a directory.
The destination path.
The relative path, or
path if the paths don't share the same root.
Paths are resolved by calling the GetFullPath method before calculating the difference. The method uses the default file path comparison for the current platform (StringComparison.OrdinalIgnoreCase for Windows and MacOs, StringComparison.Ordinal for Linux.