fun main() {
val s = "Kotlin cross-platform"
val charToFind = 'o'
val index = s.indexOf(charToFind)
if (index != -1) {
println("The first occurrence of '$charToFind' is at index $index")
} else {
println("'$charToFind' not found in the string")
}
}
/*
run:
The first occurrence of 'o' is at index 1
*/