# Ranges

**URL:** <https://www.ruby-forum.com/t/ranges/67817>\
**Category:** Ruby\
**Created:** [September 7, 2006, 12:25am UTC](https://www.ruby-forum.com/t/ranges/67817 "2006-09-07T00:25:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![quangn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/e47774/32.png) [@quangn](https://www.ruby-forum.com/u/quangn)\
**Post date:** [September 7, 2006, 12:25am UTC](https://www.ruby-forum.com/t/ranges/67817/1 "2006-09-07T00:25:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![quangn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/e47774/32.png) [@quangn](https://www.ruby-forum.com/u/quangn)\
**Post date:** [September 7, 2006, 1:11am UTC](https://www.ruby-forum.com/t/ranges/67817/2 "2006-09-07T01:11:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![quangn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/e47774/32.png) [@quangn](https://www.ruby-forum.com/u/quangn)\
**Post date:** [September 7, 2006, 1:19am UTC](https://www.ruby-forum.com/t/ranges/67817/3 "2006-09-07T01:19:21Z")

</div>

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
