当前位置:网站首页>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 something
But 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边栏推荐
- 【DRM】DRM bridge驱动调用流程简单分析
- User value is the last word in the competition of mobile phone market
- MongoDB安装 & 部署
- Without sxid, suid & sgid will be in danger- Shangwen network xUP Nange
- Applet (continuous update)
- 【学习笔记】seckill-秒杀项目--(11)项目总结
- Numpy warning visibledeprecationwarning: creating an ndarray from ragged needed sequences
- Hutool dynamically adds scheduled tasks
- How to download pytorch? Where can I download pytorch?
- Makefile demo
猜你喜欢
Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0
Error in compiled file: error: unmapped character encoding GBK
IPv6过渡技术-6to4手工隧道配置实验--尚文网络奎哥
小程序获取用户头像和昵称
Pytorch multi card distributed training distributeddataparallel usage
没有sXid,suid&sgid将进入险境!-尚文网络xUP楠哥
MongoDB簡介
Téléchargement et installation du client Filezilla
[embedded module] OLED display module
How to download pytorch? Where can I download pytorch?
随机推荐
The calculation of stripe, kernel and padding in CNN
Web会话管理安全问题
Recursion: depth first search
[mathematical logic] propositions and connectives (propositions | propositional symbolization | truth connectives | no | conjunction | disjunction | non truth connectives | implication | equivalence)
SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍
C语言HashTable/HashSet库汇总
Nanning water leakage detection: warmly congratulate Guangxi Zhongshui on winning the first famous brand in Guangxi
IPv6过渡技术-6to4手工隧道配置实验--尚文网络奎哥
docker安装及启动mysql服务
Nce detail of softmax approximation
2020-01-01t00:00:00.000000z date format conversion
Convert binary stream to byte array
How to move towards IPv6: IPv6 Transition Technology - Shangwen network quigo
node,npm以及yarn下载安装
Ffmpeg one / more pictures synthetic video
Introduction to mongodb
Separable bonds and convertible bonds
记一次 .NET 差旅管理后台 CPU 爆高分析
[MySQL] the difference between left join, right join and join
[combinatorics] basic counting principle (addition principle | multiplication principle)