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 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs