C# Extension Method: Int32 - NotIn

CSharp · Console

/Program.cs

// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002415/int32-notin

// @nuget: Z.ExtensionMethods

using System;
					
public class Program
{
	public static void Main()
	{
		Int32 searchVal = 1277;
		
		Int32[] values = { 32767, 235, 0, -1277, -32767 };

        // C# Extension Method: Int32 - NotIn
        if(searchVal.NotIn(values))
		{
			Console.WriteLine("{0} doesn't exists in the list.", searchVal);
		}
		else
		{
			Console.WriteLine("{0} exists in the list.", searchVal);
		}
	}
}
;