Mega Code Archive

 
Categories / Ruby / Statement
 

Next Skips to the end of the current iteration (which makes the loop or iterator skip on to the next iteration or item)

-10.upto(10) do |number|   next if number == 0   puts "1/" + number.to_s + " = " + (1 / Float(number)).to_s end