PathHelper.NormalizePathSegments Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Normalizes a collection of path segments by resolving relative segments like ".." and ".".
public static List<string> NormalizePathSegments(IEnumerable<string> pathSegments)Parameters
pathSegmentsIEnumerable<string>- The collection of path segments to normalize.
Returns
Exceptions
- ArgumentNullException
- Thrown when
pathSegmentsisnull.

- "." segments, which are removed as they refer to the current directory.
- ".." segments, which navigate to the parent directory by removing the previous segment.
If there are more ".." segments than parent directories available, the extra ".." segments are preserved at the beginning.