Method IFilePath.RemoveExtension
IFilePath.RemoveExtension(string, PathOptions)
Removes the specified single extension, which is the last extension of the file name. Case is ignored on every platform.
Declaration
IFilePath IFilePath.RemoveExtension(string extension, PathOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| string | extension | The single extension to remove, shaped as described for HasExtension(string). An empty extension leaves the path unchanged. |
| PathOptions | options | The options to apply when parsing the new file name. The rest of the path is not reparsed. |
Returns
| Type | Description |
|---|---|
| IFilePath |
Implements
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The extension isn't shaped as described for HasExtension(string) or has a character that names
can't have in the path format, the file name doesn't end with it, it is the whole file name, or the remaining file name is invalid for |