Check if a given number is greater then or equal to and less then a range. x >= y && x < z - CSharp System

CSharp examples for System:Int32

Description

Check if a given number is greater then or equal to and less then a range. x >= y && x < z

Demo Code


using System.Globalization;
using System.Collections.Generic;
using System.Collections;
using System;//from  ww  w  . j ava2 s.  c  om

public class Main{
        /// <summary>
      /// Check if a given number is greater then or equal to and less then a range.
      /// x &gt;= y && x &lt; z
      /// </summary>
      /// <param name="number"></param>
      /// <param name="rangeStart"></param>
      /// <param name="rangeStop"></param>
      /// <returns></returns>
      public static bool IsInExclusiveUpperRange (int number, int rangeStart, int rangeStop)
      {
         return number >= rangeStart && number < rangeStop;
      }
}

Related Tutorials