If you're going to need to do this frequently, especially if there are more than just a couple of items then you should make a function that does this:
public static bool IsOneOf(string s, params string[] many)
{
if (many == null)
throw new ArgumentNullException("many");
return ((IList<string>)many).Contains(s);
}
You would use it like:
if (!IsOneOf(dog, "cat", "cow"))
{
Console.WriteLine("A dog is not equal to a cow nor a cat!");
}
This is pretty basic.
A more advanced solution would be to make a generic extension method:
public static class MyExtensionMethods
{
public static bool IsOneOf<T>(this T s, params T[] many)
{
if (many == null)
throw new ArgumentNullException("many");
return ((IList<T>)many).Contains(s);
}
}
You would use it like:
if (!dog.IsOneOf("cat", "cow"))
{
Console.WriteLine("A dog is not equal to a cow nor a cat!");
}
There are other ways to do this, some optimized for certain cases.