Method HasExtension
HasExtension(string)
Determines whether the last extension of the file name is the specified single extension. Case is ignored on every platform.
Declaration
bool HasExtension(string extension)
Parameters
| Type | Name | Description |
|---|---|---|
| string | extension | The single extension, which starts with a dot '.' character and has no other dots (e.g. |
Returns
| Type | Description |
|---|---|
| bool | true if Extension equals the extension, ignoring case, otherwise false. |
Remarks
Extension is an empty string when the file name has no extension.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The extension is empty, isn't shaped as described for |