Here you can find the source of join(final List
static String join(final List<String> list, final String sepa)
//package com.java2s; /**// w w w . j a v a2s. c o m * Copyright (C) 2010-2012 Andrei Pozolotin <Andrei.Pozolotin@gmail.com> * * All rights reserved. Licensed under the OSI BSD License. * * http://www.opensource.org/licenses/bsd-license.php */ import java.util.List; public class Main { static String join(final List<String> list, final String sepa) { final StringBuilder text = new StringBuilder(256); final int size = list.size(); for (int k = 0; k < size; k++) { text.append(list.get(k)); if (k == size - 1) { break; } text.append(sepa); } return text.toString(); } }