ComparableExtensions.IsBetween<T>
Extension Method in ComparableExtensions
Declaration
public static bool IsBetween<T>(this T value, T min, T max, bool includeMin = true, bool includeMax = true)
where T : IComparable<T>
Description
Checks if the value is between a min and max value.
Type Parameters
T | The type of value to check. |
Parameters
value | The value to check. |
min | The minimum value. |
max | The maximum value. |
includeMin | The minimum value is inclusive if true, exclusive if false. |
includeMax | The maximum value is inclusive if true, exclusive if false. |
Returns
bool | True if the value is between the min and max value. |