[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

iterate over a series of alphabetically increasing strings

Vellingiri Arul

9/19/2007 10:45:00 AM

Dear Friends,
How could i do iterate over a series of alphabetically increasing
strings.

by
Vellingiri.
--
Posted via http://www.ruby-....

3 Answers

Robert Klemme

9/19/2007 10:54:00 AM

0

2007/9/19, Vellingiri Arul <hariharan.spc@rediffmail.com>:
> Dear Friends,
> How could i do iterate over a series of alphabetically increasing
> strings.

alphabetically_increasing_strings.each {|str| ...}

Or did you want to know how to sort them?

Cheers

robert

Vellingiri Arul

9/19/2007 10:58:00 AM

0

Robert Klemme wrote:
> 2007/9/19, Vellingiri Arul <hariharan.spc@rediffmail.com>:
>> Dear Friends,
>> How could i do iterate over a series of alphabetically increasing
>> strings.
>
> alphabetically_increasing_strings.each {|str| ...}
>
> Or did you want to know how to sort them?
>
> Cheers
>
> robert

Yes,
I want to sort them.
--
Posted via http://www.ruby-....

Sebastian Hungerecker

9/19/2007 11:16:00 AM

0

Vellingiri Arul wrote:
> > 2007/9/19, Vellingiri Arul <hariharan.spc@rediffmail.com>:

> >> Dear Friends,
> >> How could i do iterate over a series of alphabetically increasing
> >> strings.
> I want to sort them.

Then use Enumerable#sort
Like: %w(bb aa cc).sort
#=> ["aa", "bb", "cc"]


HTH,
Sebastian
--
NP: Rapture - I Am Complete
Jabber: sepp2k@jabber.org
ICQ: 205544826