commonMain.com.vanniktech.locale.capitalize.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multiplatform-locale Show documentation
Show all versions of multiplatform-locale Show documentation
Type Safe Kotlin Multiplatform Locale implementation
The newest version!
package com.vanniktech.locale
internal fun String.capitalized() = replaceFirstChar {
when {
it.isLowerCase() -> it.titlecase()
else -> it.toString()
}
}