[swift-users] For loop question?

Eirny Kwon happylogin at gmail.com
Tue Dec 15 02:08:35 CST 2015


for loop is working

for var i = 0; i < 10; i += 2 {
    print("i is \(i)")
}


On December 15, 2015 at 5:05:41 PM, cooper liu via swift-users (swift-users at swift.org) wrote:
Hi,
If the c style for loop was removed,how to implement the following code beautifully:
For(var i=0; i < 10; i+=2)
Since the range operator ... doesn't support step other than 1, and it doesn't support end value < start value.

Thanks!


 _______________________________________________
swift-users mailing list
swift-users at swift.org
https://lists.swift.org/mailman/listinfo/swift-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151215/23dfc35a/attachment.html>


More information about the swift-users mailing list