Between 值范围比较 可以判断一个值是否落在区间范围值中。 public static bool Between<T>(this T me, T lower, T upper) where T : IComparable<T> { return me.CompareTo(lower) >= 0 && me.CompareTo(upper) < 0; }
Between 值范围比较 可以判断一个值是否落在区间范围值中。 public static bool Between<T>(this T me, T lower, T upper) where T : IComparable<T> { return me.CompareTo(lower) >= 0 && me.CompareTo(upper) < 0; }
转载于:https://www.cnblogs.com/sunzhenyong/p/4663388.html