Is it possible to write a generic method which returns true or false,
depending on if the array contains a value?
Is there already a framework method that provides this functionality?
the following code does not compile. Error is: Operator == cannot be
applied to operands of type T and T.
public static bool Contains<T>(T[] InValues, T InPattern)
{
bool doesContain = false;
foreach (T vlu in InValues)
{
if (vlu == InPattern)
{
doesContain = true;
break;
}
}
return doesContain;
}