코틀린

[코틀린 Kotlin] uppercase - 대문자로 변경 (+지정 국가 언어로 변환)

멋쟁휘개발자 2024. 9. 6. 23:17

a -> A 로 변환

fun Char.uppercase(): String
fun String.uppercase(): String

 

fun Char.uppercase(locale: Locale): String
fun String.uppercase(locale: Locale): String

 

println("Kotlin".uppercase()) // KOTLIN

val turkishLocale = Locale.forLanguageTag("tr")
println("Kotlin".uppercase(turkishLocale)) // KOTLİN
 
출력 결과 : KOTLIN KOTLİN