Mega Code Archive

 
Categories / Ruby / Statement
 

Both the Integer and Date classes have downto methods

# String does not have a downto method.  # Like upto, it uses a block. 5.downto(1) { |i| print i, " " } # => 5 4 3 2 1