Here you can find the source of stringListToString(final List
final public static String stringListToString(final List<String> l, final String separator)
//package com.java2s; // License as published by the Free Software Foundation; either import java.util.List; public class Main { final public static String stringListToString(final List<String> l, final String separator) { final StringBuilder sb = new StringBuilder(); if ((l != null) && (l.size() > 0)) { for (int i = 0; i < l.size() - 1; ++i) { sb.append(l.get(i) + separator); }//from w ww. j av a2 s. c om sb.append(l.get(l.size() - 1)); } return sb.toString(); } }