Return to Snippet

Revision: 26536
at April 30, 2010 07:46 by mattcasto


Initial Code
public static bool In<T>(this T value, params T[] values)
{
    return values.Contains(value);
}

public static bool NotIn<T>(this T value, params T[] values)
{
    return !In(value, values);
}

Initial URL
InNotIn

Initial Description
I love creating simple little extension methods like these to improve code readability.

Initial Title
In & NotIn extension methods

Initial Tags
extension

Initial Language
C#