是的,它称为next 。
for i in 0..5
if i < 2
next
end
puts "Value of local variable is #{i}"
end这将输出以下内容:
Value of local variable is 2
Value of local variable is 3
Value of local variable is 4
Value of local variable is 5
=> 0..5
next
另外,请看一下redo ,它重做当前迭代。