「Swift」 for in strideのサンプル
書式
for 変数名 in stride(form:最小値,to:最大値,by:値)
使用例
let cInter = 5 for cft in stride(from: 0, to: 20, by: cInter){ print(cft) } print("**************") for cft in stride(from: 0, through: 20, by: cInter){ print(cft)
実行結果
0
5
10
15
20
**************
0
5
10
15
20