Skip to content

Instantly share code, notes, and snippets.

@CDRussell
Last active August 8, 2017 06:36
Show Gist options
  • Select an option

  • Save CDRussell/2a19ebf65b9d37f1148c138b7f65e471 to your computer and use it in GitHub Desktop.

Select an option

Save CDRussell/2a19ebf65b9d37f1148c138b7f65e471 to your computer and use it in GitHub Desktop.
Kotlin - Range Example with Silent Cast
val i = 10.5
if (i in 1..10) {
println("$i is within the range of 1-10")
} else {
println("$i is not in range of 1-10")
}
// outputs "10.5 is within the range of 1-10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment