While loop with array length : while « Statement « Ruby. ... a = [1, "test", 2, 3, 4] i = 0 while (i < a.length) puts a[i].to_s + "X" i += 1 end ...
確定! 回上一頁