rng.size â num
Instance Public methods
Returns the number of elements in the range. Both the begin and the end of the Range must be Numeric, otherwise nil is returned.
1 2 3 | ( 10 .. 20 ).size #=> 11 ( 'a' .. 'z' ).size #=> nil (-Float:: INFINITY ..Float:: INFINITY ).size #=> Infinity |
Please login to continue.