Here you can find the source of arrayJoin(String[] arr, String joinStr)
public static String arrayJoin(String[] arr, String joinStr)
//package com.java2s; //License from project: Apache License public class Main { public static String arrayJoin(String[] arr, String joinStr) { if (arr == null || arr.length == 0) return null; if (joinStr == null) joinStr = ""; StringBuffer buf = new StringBuffer(); for (String str : arr) buf.append(str).append(joinStr); return buf.substring(0, buf.length() - joinStr.length()); }/* w w w . ja v a 2s .c o m*/ }