Here you can find the source of mergeArray(T[] objs, String concatenator)
public static <T> String mergeArray(T[] objs, String concatenator)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String mergeArray(T[] objs, String concatenator) { StringBuilder sb = new StringBuilder(); for (T obj : objs) { sb.append(obj).append(concatenator); }/* w ww . ja v a2s . co m*/ return objs.length == 0 ? "" : sb.substring(0, sb.length() - concatenator.length()); } }