문자열 치환 public String replaceString(String str, char oldChar, char newChar) { String result = new String(); for (char c : str.toCharArray()) { if (oldChar == c) { result += newChar; } else { result += c; } } return result; } 프로그래밍/알고리즘 2017.02.24