IsInRange
public static bool IsInRange(this int target, int start, int end) { return target >= start && target <= end; }Example:
int foo = 4; Console.WriteLine(foo.IsInRange(2,6)); // output 'True'
Description
Finds if the int is the specified range
Details
- Author: Marwan Aouida
- Submitted on: 10/15/2010 6:34:17 PM
- Language: C#
- Type: System.Int32
- Views: 2622
Double click on the code to select all.