goja-core/src/main/java/goja/core/kits/lang/Strs.java
public static String collectionToDelimitedString(Collection<?> coll, String delim, String prefix, String suffix) {
        if (CollectionKit.isEmpty(coll)) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        Iterator<?> it = coll.iterator();
        while (it.hasNext()) {
            sb.append(prefix).append(it.next()).append(suffix);
            if (it.hasNext()) {
                sb.append(delim);
            }
        }
        return sb.toString();
    }
public static String collectionToDelimitedString(Collection<?> coll, String delim, String prefix, String suffix) {
        if (CollectionKit.isEmpty(coll)) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        Iterator<?> it = coll.iterator();
        while (it.hasNext()) {
            sb.append(prefix).append(it.next()).append(suffix);
            if (it.hasNext()) {
                sb.append(delim);
            }
        }
        return sb.toString();
    }
public static String collectionToDelimitedString ( Collection < ? > coll , String delim , String prefix , String suffix ) { if ( CollectionKit . isEmpty ( coll ) ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; Iterator < ? > it = coll . iterator ( ) ; while ( it . hasNext ( ) ) { sb . append ( prefix ) . append ( it . next ( ) ) . append ( suffix ) ; if ( it . hasNext ( ) ) { sb . append ( delim ) ; } } return sb . toString ( ) ; }
Convenience method to return a Collection as a delimited (e.g. CSV)
String. E.g. useful for {@code toString()} implementations.

@param coll   the Collection to display
@param delim  the delimiter to use (probably a ",")
@param prefix the String to start each element with
@param suffix the String to end each element with
@return the delimited String
Convenience method to return a Collection as a delimited ( e . g . CSV ) String . E . g . useful for { @code toString () } implementations .