Integral Type Ranges

suggest change

Integral ranges (IntRange, LongRange, CharRange) can be iterated. The compiler turns that into the equivalent of a Java indexed for loop, without extra overhead.

for (i in 1..4) print(i) // prints "1234"
for (i in 4..1) print(i) // prints nothing

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents