string decrement

Discussion in 'Ruby' started by Darryl Brown, May 24, 2010.

  1. Darryl Brown

    Darryl Brown Guest

    Hello All,

    It is possible to increment a string as follows:

    irb(main):001:0> x = 'a'
    => "a"
    irb(main):002:0> x.succ
    => "b"
    irb(main):003:0> x.next
    => "b"

    Is there a method to decrement a string?

    Thanks,
    Darryl
    Darryl Brown, May 24, 2010
    #1
    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. Hendrix
    Replies:
    1
    Views:
    1,677
    Ivan Vecerina
    Jun 29, 2003
  2. Mark Turney
    Replies:
    11
    Views:
    4,281
    dibeas
    Nov 13, 2006
  3. John
    Replies:
    4
    Views:
    1,139
    Vladimir Marko
    May 17, 2005
  4. Ian Pilcher

    Increment, decrement, overflow, and underflow

    Ian Pilcher, Jan 20, 2005, in forum: C Programming
    Replies:
    5
    Views:
    579
    CBFalconer
    Jan 21, 2005
  5. again some incr/decrement question

    , Jul 2, 2005, in forum: C Programming
    Replies:
    1
    Views:
    287
    Denis Kasak
    Jul 2, 2005
Loading...

Share This Page