Kotlin Check Value in Array

June 11, 2019
val items = arrayOf(1, 2, 3, 4, 5)

if (3 in items) {

}

// or
if (items.containts(3)) {

}
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.