Here you can find the source of toString(List
public static String toString(List<String> list, String delimiter)
//package com.java2s; //License from project: Apache License import java.util.Iterator; import java.util.List; public class Main { public static String toString(List<String> list, String delimiter) { String argumentString = ""; Iterator<String> iterator2 = list.iterator(); for (int i = 0; iterator2.hasNext(); i++) { String argument = iterator2.next(); if (i > 0) argumentString += delimiter; argumentString += argument;/*from w ww . j av a2s . c o m*/ } return argumentString; } }