I'm applying a function to specific file formats
string extension = Path.GetExtension(files[i]);
if (extension == ".txt")
{
DoSomething(files[i]);
}
But I have too many file extension, not only txt. What is the basic way to create a white list and check if it's included on that list?