1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Swift] ~個飛ばし数字などをループさせる方法!ex) 4飛ばしでprintしたい

Last updated at Posted at 2019-02-03

# Stride 型を用いよう!
とりあえず、サンプルコードを見てみましょう!

ex
for x in stride(from:0, to:20, by:4){
     print(x, terminator:" ")
}//0 4 8 12 16 " と表示される。

###上記の例文のようにstride型はfor分と組み合わせることが多い!
####サンプルコードを見てわかるように stide型は指定した範囲の中で~ごとに値を増やしながらループすることができます!
短いですが今回はこれで終わりです!

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?