capitalize

actual fun String.capitalize(): String (source)

Returns a copy of this string having its first letter uppercased, or the original string, if it's empty or already starts with an upper case letter.

import kotlin.test.*
import java.util.*

fun main(args: Array<String>) {
//sampleStart
println("abcd".capitalize()) // Abcd
println("Abcd".capitalize()) // Abcd
//sampleEnd
}