public static String join(String[] ary, String separator) {
        StringBuffer buf = new StringBuffer();
        for (int i=0; i<ary.length; i++) {
            if (i > 0) {
                buf.append(separator);
            }
            buf.append(ary[i]);
         }
         return buf.toString();
    }