
上QQ阅读APP看书,第一时间看更新
Using range with the when expression
In Kotlin, when is like a super-powered switch control statement. However, that's not all it can do. There's a lot of amazing logic that you can build with the when statement, one example of which is using a range with the when statement. We will take a look at that in this recipe.