Amused by .. and in operators in Kotlin
Coming from Java world, the ..
and in
operators make Kotlin really so natural to type. They are rangeTo
and contains
operator in Kotlin.
Basic
Below is something basic, like defining 1 to 10, and a to z using ..
. So natural!
val oneToTen = 1..10
val aToZ = "a".."z"