public static IsExtensionSupported ( string filePath, List |
||
filePath | string | Path of file to to check. |
supported | List |
Optionally list of supported extensions. Good if looping and can initialise supported and pass into this every loop. |
return | bool |
public static bool IsExtensionSupported(string filePath, List<string> supported = null)
{
List<string> supportedExts = supported ?? GetSupportedExtensions(true);
return supportedExts.Contains(Path.GetExtension(filePath), StringComparison.OrdinalIgnoreCase);
}