public static String join ( String separator , String [ ] parts ) { StringBuilder builder = new StringBuilder ( ) ; boolean first = true ; for ( String part : parts ) { if ( first ) { first = false ; } else { builder . append ( separator ) ; } builder . append ( part ) ; } return builder . toString ( ) ; }
Joins an array of strings together using a given separator