public static String joinWithInnerSeparator ( String separator , Object ... collection ) { StringBuilder b = new StringBuilder ( ) ; boolean first = true ; for ( Object o : collection ) { if ( first ) { first = false ; } else { b . append ( separator ) ; } b . append ( o . toString ( ) ) ; b . append ( separator ) ; } return b . toString ( ) ; }
Join an array of strings with a separator that appears after every instance in the list - except at the end