class JavaExercise_57 {
public static void main(String[] args) { // String 클래스의 join() 메서드
String str = "hello,hi,bye";
String[] strArr = str.split(",");
String strResult = String.join("~",strArr);
System.out.println(strResult);
}
}
출력 결과 :
hello~hi~bye
코드와 출력 결과를 보면 이해가 더 빠를것 입니다.