kotlin list contains string code example
Example 1: kotlin contains
var word = "grepper"
if(word.contains("pp")) {
println("yes")
}
Example 2: kotlin check if string contains
"AbBaCca".contains("bac", ignoreCase = true)
Example 3: kotlin check if element in array
// Use the contains() function
var intArray = arrayOf(10, 20, 30, 40, 50)
println(intArray.contains(10))
// Returns true