When using Kotlin 1.5, Android Studio warns that String.capitalize is deprecated.
The suggested replacement is:
myString.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() })
Why is the check for isLowerCase neccessary?
Why can't I just do this:
myString.replaceFirstChar { it.titlecase(Locale.getDefault()) })