BuildComponentUtilitiesGetRelativePath Method
This returns the path argument adjusted to be relative to the base path. Absolute path names will
be returned unchanged.
Namespace: Sandcastle.Core.BuildAssemblerAssembly: Sandcastle.Core (in Sandcastle.Core.dll) Version: 2024.9.12.0
public static string GetRelativePath(
this string path,
string basePath
)
<ExtensionAttribute>
Public Shared Function GetRelativePath (
path As String,
basePath As String
) As String
public:
[ExtensionAttribute]
static String^ GetRelativePath(
String^ path,
String^ basePath
)
[<ExtensionAttribute>]
static member GetRelativePath :
path : string *
basePath : string -> string
- path String
- The path to adjust including the filename
- basePath String
- The base path to use including the filename
StringThe path argument as a path relative to the given base pathIn Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This assumes that the path separator is "/" and that both paths include a filename
path: "xxx/aaa/target.html"
basePath: "xxx/bbb/source.html"
result: "../aaa/target.html"