2009/12/4 Mike Stok <(E-Mail Removed)>:
> On Dec 4, 2009, at 7:22 AM, Teodor Carstea wrote:
>> what is Ruby's style of increment/decrement?
>> I mean like in C++
>> or someVar--
> Take a look at http://ruby-doc.org/docs/Newcomers/ruby.html#operators which includes "To increment a number, simply write x += 1T."
Teodor, if you now start wondering why there is no i++ in Ruby please
see the recent thread "Ruby doesn't implement x++ for Fixnum's because
Am Freitag, 04. Dez 2009, 21:34:31 +0900 schrieb Paul Smith:
> On Fri, Dec 4, 2009 at 12:22 PM, Teodor Carstea <(E-Mail Removed)> wrote:
> > what is Ruby's style of increment/decrement?
> > I mean like in C++
> > someVar++
> > or someVar--
> someVar += 1
You may also say
someVar = someVar.succ
With strings even this works:
str = "A0000"
For iterating use somethig like Fixnum#times or Array#each.