This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Incubator.
Summary
Checks if the path has a specific file extension (case-insensitive)
- Assembly
- Cake
.Incubator .dll - Namespace
- Cake
.Incubator .FilePathExtensions - Containing Type
- FilePathExtensions
Syntax
public static bool HasFileExtension(this FilePath path, string fileExtension)
Examples
Check the file extension with or without the period ignoring case
new FilePath("/folder/testing.cs").HasExtension(".cs"); // true
new FilePath("/folder/testing.odd").HasExtension("ODD"); // true
Parameters
Name | Type | Description |
---|---|---|
path | FilePath | the path to check |
fileExtension | string | the file extension name |
Return Value
Type | Description |
---|---|
bool | true if file extension matches |