Method IsValidExtension
IsValidExtension(ReadOnlySpan<char>, PathOptions)
Determines whether the given file extension is a valid single extension for this path format.
Declaration
public virtual bool IsValidExtension(ReadOnlySpan<char> extension, PathOptions options = PathOptions.NoUnfriendlyNames)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | extension | The extension to check. |
| PathOptions | options | The options the extension is checked with. |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
The empty extension is valid for all path formats.
If non-empty, the extension should begin with a . character, and not have any . characters after the first one. A lone . is
valid.
HasExtension(string), RemoveExtension(string, PathOptions), AddExtension(string?, PathOptions) and WithExtension(string?, PathOptions) take an extension that is valid with None.