<p>I have an enum </p>

<pre><code>public enum FileExtentions {
    mp3,
    mpeg
}
</code></pre>

<p>And I have a FileInfo of which I want to check if the extension is in the previous enum.
I was hoping I could do a </p>

<pre><code>FileExtensions.Any(e=&gt;e.ToString().Equals(file.Extension));
</code></pre>

<p>But that would have been too awesome.
Any ideas?</p>

While pressing submit I thought of the answer myself:
```
```
Enum.GetNames(typeof(FileExtensions)).Any(f=>f.Equals("."+file.Extension))
```
```