Here you can find the source of mergeJoin(String sep, String[] a1, String[] a2)
public static String mergeJoin(String sep, String[] a1, String[] a2)
//package com.java2s; // License as published by the Free Software Foundation; either public class Main { public static String mergeJoin(String sep, String[] a1, String[] a2) { if (a1.length != a2.length) { System.out.println("Unable to merge String arrays of different length!"); return join(a1); }/*from www .j a v a 2 s . c o m*/ StringBuilder sb = new StringBuilder(a1[0]); sb.append(sep).append(a2[0]); for (int i = 1; i < a1.length; i++) sb.append(" ").append(a1[i]).append(sep).append(a2[i]); return sb.toString(); } public static String join(Object[] array) { return join(" ", array); } public static String join(String sep, Object[] array) { StringBuilder sb = new StringBuilder(array[0].toString()); for (int i = 1; i < array.length; i++) sb.append(sep).append(array[i].toString()); return sb.toString(); } public static String join(String[] array) { return join(" ", array); } public static String join(String sep, String[] array) { StringBuilder sb = new StringBuilder(array[0]); for (int i = 1; i < array.length; i++) sb.append(sep).append(array[i]); return sb.toString(); } public static String join(int[] array) { return join(" ", array); } public static String join(String sep, int[] array) { StringBuilder sb = new StringBuilder(Integer.toString(array[0])); for (int i = 1; i < array.length; i++) sb.append(sep).append(array[i]); return sb.toString(); } public static String join(double[] array) { return join(" ", array); } public static String join(String sep, double[] array) { StringBuilder sb = new StringBuilder(Double.toString(array[0])); for (int i = 1; i < array.length; i++) sb.append(sep).append(array[i]); return sb.toString(); } }