public static String implode(final String[] array,final String delim,final boolean quoteStringsWithSpaces){
  final StringBuilder sb=new StringBuilder();
  for (int i=0; i < array.length; i++) {
    if (i != 0 && delim != null) {
      sb.append(delim);
    }
    sb.append(quoteStringsWithSpaces ? smartQuote(array[i]) : array[i]);
  }
  return sb.toString();
}

public static String implode ( final String [ ] array , final String delim , final boolean quoteStringsWithSpaces ) { final StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( i != 0 && delim != null ) { sb . append ( delim ) ; } sb . append ( quoteStringsWithSpaces ? smartQuote ( array [ i ] ) : array [ i ] ) ; } return sb . toString ( ) ; }
implodes a string array into a string .
