# Arrays in Ruby

**URL:** <https://www.ruby-forum.com/t/arrays-in-ruby/172486>\
**Category:** Rails\
**Created:** [July 22, 2009, 8:42am UTC](https://www.ruby-forum.com/t/arrays-in-ruby/172486 "2009-07-22T08:42:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [July 22, 2009, 8:42am UTC](https://www.ruby-forum.com/t/arrays-in-ruby/172486/1 "2009-07-22T08:42:51Z")

</div>

Hi Champs,

The scenario is something like this …  
I am having an array which consists of elements as:-  
array[0] = dayName;  
array[1] = date;  
array[2] = AnotherDayname … may be same …  
array[3] = anotherdate … may be same …  
array[4] = AnotherDayname … may be same …  
array[5] = anotherdate … may be same …  
and go on …

Fine … What i want is that we should match all dates to one another in  
array … and if the dates matches with another then show them with their  
same daynames …

like as:- if array[3] and array[5] matches … the we should show it like  
this as…  
array[2]-array[4]: array[3]

Note that once a day or date comes can not repeat itself …

getting me … 🙂
