src/main/java/pw/phylame/util/StringUtils.java
/**
     * Joins string collection to string.
     * @param <T> the class of the objects in the array
     * @param seq collection of object or string
     * @param separator separator between string and string
     * @return joined string
     */
Joins string collection to string.
@param  the class of the objects in the array
@param seq collection of object or string
@param separator separator between string and string
@return joined string
Joins string collection to string . @param the class of the objects in the array @param seq collection of object or string @param separator separator between string and string @return joined string
public static <T> String join(Collection<T> seq, String separator) {
        int iMax = seq.size() - 1;
        if (iMax == -1) {
            return "";
        }
        StringBuilder b = new StringBuilder();
        int ix = 0;
        for (T o: seq) {
            b.append(o);
            if (ix++ == iMax) {
                break;
            }
            b.append(separator);
        }
        return b.toString();
    }
public static < T > String join ( Collection < T > seq , String separator ) { int iMax = seq . size ( ) - 1 ; if ( iMax == - 1 ) { return "" ; } StringBuilder b = new StringBuilder ( ) ; int ix = 0 ; for ( T o : seq ) { b . append ( o ) ; if ( ix ++ == iMax ) { break ; } b . append ( separator ) ; } return b . toString ( ) ; }
Joins string collection to string.
Joins string collection to string .