replaceFirstChar - Kotlin Programming Language
println("kotlin".replaceFirstChar { it.uppercase() }) // Kotlin
val sentence = "Welcome to Kotlin!"
val words = sentence.split(' ');
println(words.joinToString(separator = "_")
{ word -> word.replaceFirstChar { it.lowercase() } }) // welcome_to_kotlin!
Remove a Character From a String in Kotlin | Baeldung on Kotlin
val string = "Ba.eldung"
assertEquals("Baeldung", string.replace(".", ""))
val string = "Ba.eldung"
assertEquals("Baeldung", string.filterNot { it == '.' })