class Solution {
public String solution(String my_string, String letter) {
String answer = "";
while(true) {
int a = my_string.indexOf(letter);
if(a == -1) break;
my_string = my_string.substring(0,a)+my_string.substring(a+1);
}
answer = my_string;
return answer;
}
}
'Study with me > 프로그래머스 L0 마스터하기' 카테고리의 다른 글
프로그래머스 - L0 모음제거 (0) | 2023.11.08 |
---|---|
프로그래머스 - L0 제곱수판별하기 (0) | 2023.11.06 |
프로그래머스 - L0 중앙값구하기 (0) | 2023.11.03 |
프로그래머스 - L0 문자반복출력하기 (0) | 2023.10.23 |
프로그래머스 - L0 문자열안에문자열 (0) | 2023.10.20 |