kotlin string contains 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 substring in string
val name = "James Smith"
// contains() returns true if 'James is in
// string name and false otherwise
val isSubstring = name.contains("James")