Java tutorial
import java.util.StringJoiner; public class Main { public static void main(String[] argv) { StringJoiner sj = new StringJoiner(":", "[", "]"); sj.add("George").add("Sally").add("Fred"); String desiredString = sj.toString(); System.out.println(desiredString); } }