231220 JAVA Test01 (programmers)
2023. 12. 21. 09:42ㆍ2023.11.21-2024.05.31
package kr.co.programmers;
public class Test01 {
public static String solution(String my_string, String overwrite_string, int s) {
String start = my_string.substring(0, s);
String end = my_string.substring(s + overwrite_string.length());
String answer = start + overwrite_string + end;
return answer;
}
public static void main(String[] args) {
String result = solution("He11oWor1d", "lloWorl", 2);
System.out.println(result);
result = solution("Program29b8UYP", "merS123", 7);
System.out.println(result);
}
}
'2023.11.21-2024.05.31' 카테고리의 다른 글
231221 JAVA WrapperEx(래퍼클래스) (1) | 2023.12.21 |
---|---|
231221 JAVA Test01 (programmers-콜라문제) (0) | 2023.12.21 |
231220 JAVA enum(열거형 타입) (0) | 2023.12.21 |
231220 JAVA IsAHasA (1) | 2023.12.21 |
231220 JAVA memory(메모리 구조) (0) | 2023.12.20 |