Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, Ruby has a "do .. while" loop, but it is called the "begin .. while" loop in Ruby. Here's an example:

i = 0
begin
  puts i
  i += 1
end while i < 10

This code will print the numbers from 0 to 9.