C# Extension Method: SByte - In

CSharp · Console

/Program.cs

// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002586/sbyte-in

// @nuget: Z.ExtensionMethods

using System;
					
public class Program
{
	public static void Main()
	{
		sbyte searchVal = -12;

        // C# Extension Method: SByte - In
		Display(searchVal, searchVal.In(127, 35, 0, -12, -127));
		Display(searchVal, searchVal.In(127, 35, 0, -13, -127));
        
	}
	
	public static void Display(object searchVal, bool status)
	{
		if(status)
		{
			Console.WriteLine("{0} is in the list.", searchVal);
		}
		else
		{
			Console.WriteLine("{0} is not in the list.", searchVal);
		}
	}
}
;