我在谷歌上搜索了关于Range参数作用的解释,但什么也没有找到,所以我相信您会解释在使用It.IsInRange(TValue from, TValue to, Range rangeKind)时设置Range.Inclusive或Range.Exclusive有什么区别
发布于 2011-11-11 17:39:07
我不确定,但我假设包含意味着您为范围提供的值是范围的一部分,而排除意味着它们不是范围的一部分:
包含:下界<= x <=上界
排他性:下界
发布于 2018-05-15 01:03:06
在documentation中指定的范围(枚举)参数-
Exclusive : The range does not include the to and from values.
Inclusive : The range includes the to and from values.如答案所示的用法
It.IsInRange(0, 100, Range.Exclusive); // will not match for int values 0 and 100, but matches 1 to 99和
It.IsInRange(0, 100, Range.Inclusive); // will match for int values 0 and 100, and in-betweenhttps://stackoverflow.com/questions/8091965
复制相似问题