Dear Friends,
How could i do iterate over a series of alphabetically increasing
strings.
by
Vellingiri.
Dear Friends,
How could i do iterate over a series of alphabetically increasing
strings.
by
Vellingiri.
2007/9/19, Vellingiri A. [email protected]:
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
Robert K. wrote:
2007/9/19, Vellingiri A. [email protected]:
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.
Vellingiri A. wrote:
2007/9/19, Vellingiri A. [email protected]:
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
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