touppercase1 81 프로그머스] Kotlin 대소문자 바꿔서 출력하기 fun main(args: Array) { val s1 = readLine()!! var ans = "" for(i in 0 until s1.length) { if(Character.isUpperCase(s1[i])) { ans += Character.toLowerCase(s1[i]); } else { ans += Character.toUpperCase(s1[i]); } } println(ans) } https://notepad96.tistory.com/89 Kotlin UpperCase & LowerCase - 대소문자 검사 및 변환 1. UpperCase, LowerCase 문자열을 대문자 혹은 소문자로 변환하거나 현재 대문자인지 소문자인지 검사하고 싶을 경우가 있다. 무언가를 판별하는 함수 앞에는 .. 2023. 10. 8. 이전 1 다음