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
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 Nordwick 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 Nordwick 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