자바 String.join()

1 개요[ | ]

자바 String.join()
System.out.println( String.join(" - ", "Alice", "Bob", "Carol") );
// Alice - Bob - Carol
System.out.println( String.join(" - ", new String[] {"Alice", "Bob", "Carol"}) );
// Alice - Bob - Carol
System.out.println( String.join(" - ", Arrays.asList("Alice", "Bob", "Carol")) );
// Alice - Bob - Carol
String[] strs = {"Alice", "Bob", "Carol"};
System.out.println( String.join(" - ", strs) );
// Alice - Bob - Carol
List<String> strs = Arrays.asList("Alice", "Bob", "Carol");
System.out.println( String.join(" - ", strs) );
// Alice - Bob - Carol

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}