class Solution {
public String solution(String myString) {
String answer = "";
return answer;
}
}
해결법
방법 1
class Solution {
public String solution(String myString) {
myString = myString.toLowerCase();
myString = myString.replaceAll("a", "A");
return myString;
}
}
방법 2
class Solution {
public String solution(String myString) {
String answer = "";
for (int i = 0; i < myString.length(); i++) {
String s = myString.charAt(i) + "";
if (s.equals("a") || s.equals("A")) {
s = s.toUpperCase();
} else {
s = s.toLowerCase();
}
answer += s;
}
return answer;
}
}
A 강조하기 Lv. 0