Java Collection to String listToStringHelper(StringBuilder sb, String sep, Collection list)

Here you can find the source of listToStringHelper(StringBuilder sb, String sep, Collection list)

Description

list To String Helper

License

Open Source License

Declaration

private static StringBuilder listToStringHelper(StringBuilder sb, String sep, Collection<?> list) 

Method Source Code

//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;
    }
}

Related

  1. listToString(Collection aList, String aDelimiter, boolean quoteEntries)
  2. listToString(Collection collection)
  3. listToString(Collection l, String delim)
  4. listToString(Collection objects)
  5. listToStringArray(Collection list)
  6. stringify(Collection collection)
  7. stringify(Collection collection)
  8. toStr(Collection collection)
  9. toStr(Collection elements)