ExtensionMethod.NET Home of 818 C#, Visual Basic, F# and Javascript extension methods

In

C# version of In clause of sql query.

Source

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

Example

string value = "net";
bool isIn = value.In("dot", "net", "languages"); //true
isIn = value.In("dot", "note", "languages"); //false

Author: Raveendra sharma

Submitted on: 1 nov 2012

Language: C#

Type: System.Type

Views: 5288