Here you can find the source of concat(String[] array, String separator)
public static String concat(String[] array, String separator)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static <T> T[] concat(T[] first, T[] second) { T[] result = Arrays.copyOf(first, first.length + second.length); System.arraycopy(second, 0, result, first.length, second.length); return result; }//from w w w . j a va 2s .c o m public static String concat(String[] array, String separator) { StringBuilder sb = new StringBuilder(); String sep = ""; for (String s : array) { sb.append(sep).append(s); sep = separator; } return sb.toString(); } }