public static String join ( Collection strings , String delimiter ) { StringBuilder builder = new StringBuilder ( ) ; Iterator < String > iter = strings . iterator ( ) ; while ( iter . hasNext ( ) ) { builder . append ( iter . next ( ) ) ; if ( ! iter . hasNext ( ) ) { break ; } builder . append ( delimiter ) ; } return builder . toString ( ) ; }
Joins a collection of string with a given delimiter .