- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 69字
- 2021-07-02 23:54:26
The stride functions
stride functions enable us to iterate through ranges with a step other than one. There are two stride functions: the stride to function, which iterates over exclusive ranges, and stride through, which iterates over inclusive ranges. Consider the following example:
let fourToTwo = Array(stride(from: 4, to: 1, by: -1)) // [4, 3, 2]
let fourToOne = Array(stride(from:4, through: 1, by: -1)) // [4, 3, 2, 1]
推薦閱讀
- Redis使用手冊
- 在你身邊為你設計Ⅲ:騰訊服務設計思維與實戰
- Hands-On Machine Learning with Microsoft Excel 2019
- Unity 5.x Game AI Programming Cookbook
- 復雜性思考:復雜性科學和計算模型(原書第2版)
- Access 2016數據庫技術及應用
- Creating Dynamic UIs with Android Fragments(Second Edition)
- The Game Jam Survival Guide
- Splunk智能運維實戰
- 數據科學實戰指南
- Augmented Reality using Appcelerator Titanium Starter
- R Machine Learning Essentials
- Python 3爬蟲、數據清洗與可視化實戰
- 大數據隱私保護技術與治理機制研究
- Machine Learning for Mobile