[lang-ref] ( capitalize ) ( kotlin )
@Disabled("Not supported")
@Test
fun capitalize() {
//
// String.capitalize is deprecated
}
@Test
fun capitalizeAlternative() {
val s = "abc def ghi"
val capitalized = s.replaceFirstChar { c ->
if (c.isLowerCase()) {
c.titlecase()
} else {
c.toString()
}
}
assertEquals("Abc def ghi", capitalized)
}