PathHelper.TryNormalizePath Method

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

Definition

Attempts to normalize the specified path by resolving relative segments like ".." and ".", and replacing backslashes with forward slashes.
public static bool TryNormalizePath(string path, [NotNullWhen(true)] out string normalizedPath)

Parameters

path string
The path to normalize.
normalizedPath string
When this method returns, contains the normalized path if the operation was successful; otherwise, null.

Returns

bool
true if the path was normalized successfully; otherwise, false.

Exceptions

ArgumentNullException
Thrown when path is null.