iterate over a series of alphabetically increasing strings

Discussion in 'Ruby' started by Vellingiri Arul, Sep 19, 2007.

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

    by
    Vellingiri.
    --
    Posted via http://www.ruby-forum.com/.
     
    Vellingiri Arul, Sep 19, 2007
    #1
    1. Advertising

  2. 2007/9/19, Vellingiri Arul <>:
    > 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 Klemme, Sep 19, 2007
    #2
    1. Advertising

  3. Re: iterate over a series of alphabetically increasing strin

    Robert Klemme wrote:
    > 2007/9/19, Vellingiri Arul <>:
    >> 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-forum.com/.
     
    Vellingiri Arul, Sep 19, 2007
    #3
  4. Re: iterate over a series of alphabetically increasing strin

    Vellingiri Arul wrote:
    > > 2007/9/19, Vellingiri Arul <>:


    > >> 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:
    ICQ: 205544826
     
    Sebastian Hungerecker, Sep 19, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gogo
    Replies:
    1
    Views:
    2,119
    Sudsy
    Sep 4, 2003
  2. runescience
    Replies:
    0
    Views:
    1,477
    runescience
    Feb 9, 2006
  3. Diez B. Roggisch

    iterate over a series of nodes in an XML file

    Diez B. Roggisch, Jul 5, 2006, in forum: Python
    Replies:
    4
    Views:
    2,405
    Steve M
    Jul 5, 2006
  4. John
    Replies:
    4
    Views:
    932
    RedGrittyBrick
    Apr 1, 2008
  5. Brion
    Replies:
    10
    Views:
    171
    Brion
    Sep 3, 2007
Loading...

Share This Page