Return to Snippet

Revision: 26535
at April 30, 2010 07:43 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

                                

Initial Description
I love creating simple little extension methods like this to make my code read more better.

Initial Title
In & NotIn extension methods

Initial Tags
extension

Initial Language
C#