Here you can find the source of listToStringHelper(StringBuilder sb, String sep, Collection> list)
private static StringBuilder listToStringHelper(StringBuilder sb, String sep, Collection<?> list)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { private static StringBuilder listToStringHelper(StringBuilder sb, String sep, Collection<?> list) { for (Object line : list) { sb.append(line).append(sep); }// ww w . ja v a2 s . c om if (sb.length() > 0) { sb.setLength(sb.length() - sep.length()); } return sb; } }