当前位置:网站首页>How to execute a swift for in loop in one step- How can I do a Swift for-in loop with a step?
How to execute a swift for in loop in one step- How can I do a Swift for-in loop with a step?
2022-07-03 03:48:00 【javail】
problem :
With the removal of the traditional C-style for-loop in Swift 3.0 , how can I do the following? Delete Swift 3.0 Chinese traditional C style for After the cycle , How do I do the following ?
for (i = 1; i < max; i+=2) { // Do something}In Python, the for-in control flow statement has an optional step value: stay Python in ,for-in The control flow statement has an optional step value :
for i in range(1, max, 2): # Do somethingBut the Swift range operator appears to have no equivalent: however Swift The range operator seems to have no equivalent :
for i in 1..<max { // Do something}Solution :
Reference resources : https://stackoom.com/en/question/2PBxa边栏推荐
- redis在服务器linux下的启动的相关命令(安装和配置)
- C语言HashTable/HashSet库汇总
- Advanced redis applications [password protection, data persistence, master-slave synchronization, sentinel mode, transactions] [not completed yet (semi-finished products)]
- Summary of electromagnetic spectrum
- Avec trois. JS fait une scène 3D simple
- FileZilla Client下載安裝
- 简易版 微信小程序开发之页面跳转、数据绑定、获取用户信息、获取用户位置信息
- @The difference between Autowired, @qualifier, @resource
- [set theory] partial order relation (partial order relation definition | partial order set definition | greater than or equal to relation | less than or equal to relation | integer division relation |
- TCP/IP模型中的重磅嘉宾TCP--尚文网络奎哥
猜你喜欢

Web session management security issues

QQ小程序开发之 一些前期准备:预约开发账号、下载安装开发者工具、创建qq小程序

Recursion: one dimensional linked lists and arrays

SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍

UMI route interception (simple and rough)

Ansible简介【暂未完成(半成品)】

What can learning pytorch do?

Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
![Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence](/img/60/bae0e8d92a53bcd2b2de3fb22b3b99.jpg)
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence

Recursion: depth first search
随机推荐
Basic operations of mongodb [add, delete, modify, query]
动态规划:最长公共子串和最长公共子序列
MongoDB安装 & 部署
阿洛对自己的思考
Lvgl usage experience
Elsevier latex submitted the article pdftex def Error: File `thumbnails/cas-email. jpeg‘ not found: using draf
[DRM] simple analysis of DRM bridge driver call process
Ansible简介【暂未完成(半成品)】
C语言HashTable/HashSet库汇总
105. SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍
node,npm以及yarn下载安装
Captura下载安装及在Captura配置FFmpeg
Debug: CD cannot be used in kaggle
Half of 2022 is over, so we must hurry up
Ffmpeg download and installation tutorial and introduction
Open Visual Studio 2010 hangs when opening a SQL file sql file
Leetcode: dynamic planning template
pytorch开源吗?
TCP, the heavyweight guest in tcp/ip model -- Kuige of Shangwen network
[AI practice] Application xgboost Xgbregressor builds air quality prediction model (I)