capitalize

fun String.capitalize(locale: Locale = Locale.US): String(source)

Capitalizes the first character of this String using the specified locale.

Receiver

The original String.

Return

The string with the first character capitalized.

Parameters

locale

The Locale to be used for capitalization. Defaults to Locale.US.


Replaces the deprecated Kotlin version, but hard-codes Locale.US