C# Extension Method: Int16 - Between

CSharp · Console

/Program.cs

// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002381/int16-between

// @nuget: Z.ExtensionMethods

using System;
					
public class Program
{
	public static void Main()
	{
		Int16 searchVal = 7;
		
		Int16 minVal = 10;
		
		Int16 maxVal = 32;

        // C# Extension Method: Int16 - Between
        if(searchVal.Between(minVal, maxVal))
		{
			Console.WriteLine("{0} is between {1} and {2}", searchVal, minVal, maxVal);
		}
		else
		{
			Console.WriteLine("{0} is not between {1} and {2}", searchVal, minVal, maxVal);
		}
	}
}
;