Ranges

Is there a way to make the lower end or both ends of a range exclusive?
I would like (1…5) and (1…5]

-jason

Jason N. wrote:

Is there a way to make the lower end or both ends of a range exclusive?
I would like (1…5) and (1…5]

-jason

Use three points to exclude the end:

(1…5).to_a
=> [1, 2, 3, 4, 5]

(1…5).to_a
=> [1, 2, 3, 4]

Robin

Jason N. wrote:

Is there a way to make the lower end or both ends of a range exclusive?
I would like (1…5) and (1…5]

Sorry, you can only exclude the upper bound (with …).

Hal