PathHelper.IsSubpath Method

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

Definition

Determines if a sub-path is a valid sub-path of a full path.
public static bool IsSubpath(string fullPath, string subPath)

Parameters

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

Returns

bool
true if the full path matches the sub-path; otherwise, false.

Exceptions

ArgumentNullException
Thrown when fullPath or subPath is null.

Remarks

This method checks if the subPath is a valid sub-path of the fullPath. The match is case-insensitive.
The method assumes that both paths are normalized and use the same directory separator.