static String join ( String sep , String ... elements ) { StringBuilder sb = new StringBuilder ( ) ; for ( String e : elements ) { if ( e != null ) { if ( sb . length ( ) > 0 ) { sb . append ( sep ) ; } sb . append ( e ) ; } } return sb . toString ( ) ; }
Joins a list of strings using the given separator .