내 답안
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 += Character.toLowerCase(c);
} else{
answer += c;
}
}
return answer;
}
}
Java
복사
다른사람 풀이
class Solution {
public String solution(String myString) {
return myString.toLowerCase();
}
}
Java
복사
class Solution {
public String solution(String myString) {
StringBuilder sb = new StringBuilder();
for(char k : myString.toCharArray()){
sb.append(Character.toLowerCase(k));
}
String answer = String.valueOf(sb);
return answer;
}
}
Java
복사