Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
if is revised, it is an expression :
Kotlin doesn't have a
switch keyword, it replaces it with a powerful
when expression, similar to pattern matching :
For loops are implemented as
foreach loops, using
in keyword :
rangeTo functions ranges can be defined for any comparable type.
.. operator is used to define ranges,
!in to check if a value is included in a range or to iterate over a range (for integral type).
until can be used to revert the range, change the progression step or exclude the last value.