20 lines
No EOL
475 B
C#
20 lines
No EOL
475 B
C#
namespace JD.Collections
|
|
{
|
|
public static class IsInExtension
|
|
{
|
|
/// <summary>
|
|
/// True if the current value is in the set.
|
|
/// </summary>
|
|
public static bool IsIn<T>(this T value, params T[] set)
|
|
{
|
|
foreach (var otherValue in set)
|
|
{
|
|
if (Equals(value, otherValue))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
} |