logo
  • 教程列表
  • SO官方文檔
  • 控制流
    • 如果 elsif 別的並且結束
    • case 語句
    • Truthy 和 Falsy 的值
    • 內聯 ifunless
    • 直到
    • Or-EqualsConditional 賦值運算子()
    • 觸發器運算子
    • 除非
    • 抓住
    • 三元運算子
    • 迴圈控制與休息下一步和重做
    • 在塊中返回與下一個非本地返回
    • 用邏輯語句控制流程
    • 開始結束
  1. StackOverflow 文件
  2. Ruby Language 教程
  3. 控制流
  4. 直到

直到

Created: November-22, 2018

當滿足給定條件時,while 迴圈執行塊:

i = 0
while i < 5
  puts "Iteration ##{i}"
  i +=1
end

當條件為假時,until 迴圈執行塊:

i = 0
until i == 5
  puts "Iteration ##{i}"
  i +=1
end
  • Or-EqualsConditional 賦值運算子()
  • 內聯 ifunless

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明