Kotlin has the follow for
for (i in 0..10) {}
it is similar to Java
for (int i = 0; i < 10; i++) {}
but how change the increment in kotlin to get something like it in java:
for (int i = 0; i < 10; i = i + 2) {}
Kotlin has the follow for
for (i in 0..10) {}
it is similar to Java
for (int i = 0; i < 10; i++) {}
but how change the increment in kotlin to get something like it in java:
for (int i = 0; i < 10; i = i + 2) {}
for (i in 1..4 step 2) print(i) // prints "13"