오랜만에 문제를 복습하다가 기록하고 싶은게 있으면 다시 포스팅 하고 있다!
새로운 마음으로 풀어보고, 이전에 풀었던 것과 비교해보면 내가 많이 성장했다는 것을 실감한다.
동시에 아직 부족하다는 것도 느껴진다! 하하

class Solution {
    public String solution(String s) {
        String answer = "";
        int index = 0;
        
        for(int i=0;i<s.length();i++) {
            if(s.charAt(i)!=' ' && index%2==0) {
                answer+= Character.toUpperCase(s.charAt(i));
                index++;
            } else if(s.charAt(i)!=' ' && index%2!=0) {
                answer+= Character.toLowerCase(s.charAt(i));
                index++;
            } else {
                answer+= s.charAt(i);
                index=0;
            }
        }
        
        return answer;
    }
}
문제를 읽은 후, toUpperCase() 와 toLowerCase() 가 떠올랐다.
그래서 s.charAt(i).toUpperCase() 라고 사용했는데 인식을 못하는 것이다!
왜냐하면 저 메서드는 String 클래스에 속해있기 때문이었다.
검색해보니 Char에는 Character.toUpperCase( s.charAt(i) )  로 사용 할 수 있었다.
Char는Character.toUpperCase()라는 것을 기억해놔야겠다!