Here you can find the source of concatArray(String[] array, String glue)
public static String concatArray(String[] array, String glue)
//package com.java2s; public class Main { public static String concatArray(String[] array, String glue) { StringBuilder sb = new StringBuilder(); for (String s : array) { sb.append(s);//from w w w. j a va 2 s .c om sb.append(glue); } return sb.toString().substring(0, sb.toString().lastIndexOf(glue)); } public static String concatArray(String[] array, String glue, int start) { String[] narray = new String[array.length - start]; int pointer = 0; for (int i = start; i < array.length; i++) { narray[pointer] = array[i]; pointer++; } return concatArray(narray, glue); } }