Method TryParse
TryParse(ReadOnlySpan<char>, out IDirectoryPath?)
Attempts to parse an absolute or relative directory path using the NoUnfriendlyNames option and the current platform's format.
Declaration
public static bool TryParse(ReadOnlySpan<char> path, out IDirectoryPath? result)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | path | A directory path. |
| IDirectoryPath | result | When this method returns, contains the parsed path if parsing succeeded, otherwise null. |
Returns
| Type | Description |
|---|---|
| bool |
TryParse(ReadOnlySpan<char>, PathFormat, out IDirectoryPath?)
Attempts to parse an absolute or relative directory path using the specified format and the NoUnfriendlyNames option.
Declaration
public static bool TryParse(ReadOnlySpan<char> path, PathFormat format, out IDirectoryPath? result)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | path | A directory path. |
| PathFormat | format | The path's format. |
| IDirectoryPath | result | When this method returns, contains the parsed path if parsing succeeded, otherwise null. |
Returns
| Type | Description |
|---|---|
| bool |
TryParse(ReadOnlySpan<char>, PathOptions, out IDirectoryPath?)
Attempts to parse an absolute or relative directory path using the specified options and the current platform's format.
Declaration
public static bool TryParse(ReadOnlySpan<char> path, PathOptions options, out IDirectoryPath? result)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | path | A directory path. |
| PathOptions | options | Specifies the path parsing options. |
| IDirectoryPath | result | When this method returns, contains the parsed path if parsing succeeded, otherwise null. |
Returns
| Type | Description |
|---|---|
| bool |
TryParse(ReadOnlySpan<char>, PathFormat, PathOptions, out IDirectoryPath?)
Attempts to parse an absolute or relative directory path using the specified format and options.
Declaration
public static bool TryParse(ReadOnlySpan<char> path, PathFormat format, PathOptions options, out IDirectoryPath? result)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | path | A directory path. |
| PathFormat | format | The path's format. |
| PathOptions | options | Specifies the path parsing options. |
| IDirectoryPath | result | When this method returns, contains the parsed path if parsing succeeded, otherwise null. |
Returns
| Type | Description |
|---|---|
| bool |