내 답안
class Solution {
public String solution(String myString) {
String answer = "";
for(int i = 0; i< myString.length();i++){
char c = myString.charAt(i);
if(Character.isUpperCase(c)){
answer += c;
} else{
answer += Character.toUpperCase(c);
}
}
return answer;
}
}
Java
복사
다른사람 풀이
class Solution {
public String solution(String myString) {
return myString.toUpperCase();
}
}
Java
복사
class Solution {
public String solution(String myString) {
String answer = "";
for(int i=0; i<myString.length(); i++){
char str = myString.charAt(i);
answer += Character.toUpperCase(str);
}
return answer;
}
}
Java
복사