Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > string decrement

Thread Tools

string decrement

Darryl Brown
Posts: n/a
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"
=> "b"

Is there a method to decrement a string?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ambiguity of post-increment and post-decrement Mark Turney C++ 11 11-13-2006 04:41 PM
again some incr/decrement question C Programming 1 07-02-2005 12:38 PM
map : iterator increment/decrement code John C++ 4 05-17-2005 09:51 AM
Increment, decrement, overflow, and underflow Ian Pilcher C Programming 5 01-21-2005 03:26 AM
How can I increment/decrement a multidemensional array without a loop? Hendrix C++ 1 06-29-2003 07:59 AM