// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Arrays;

public class SplitJoin {
    public static void main(String[] args) {
        String s1 = "A BB CCC";
        String[] p = s1.split(" ");
        String s2 = Arrays.toString(p);
        System.out.println(s2);
        String s3 = Arrays.toString(p).replaceAll("[\\[\\],]", "");
        System.out.println(s3);
    }
}
