PathHelper.IsSubpath Method

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll

Definition

Determines whether a subpath matches the end of a full path at a path-segment boundary.
public static bool IsSubpath(string subPath, string fullPath)

Parameters

subPath string
The sub-path to check.
fullPath string
The full path to check against.

Returns

bool
true if subPath matches the complete fullPath or its trailing path segments; otherwise, false.

Exceptions

ArgumentNullException
Thrown when fullPath or subPath is null.

Remarks

Matching is case-insensitive. An empty subpath matches only an empty full path.
The method assumes that both paths are normalized and use the same directory separator.