Here you can find the source of join(String[] strParts, String glue)
public static String join(String[] strParts, String glue)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(String[] strParts, String glue) { StringBuilder str = new StringBuilder(); for (int i = 0; i < strParts.length; i++) { str.append(strParts[i]).append(glue); }/*from www . j av a2 s. co m*/ if (str.length() > 0) str.delete(str.length() - glue.length(), str.length()); return str.toString(); } public static String join(List<String> strParts, String glue) { StringBuilder str = new StringBuilder(); for (int i = 0; i < strParts.size(); i++) { str.append(strParts.get(i)).append(glue); } if (str.length() > 0) str.delete(str.length() - glue.length(), str.length()); return str.toString(); } }