public static String implode(String[] elements,String separator){
  if (elements == null) {
    return null;
  }
  if (elements.length == 0) {
    return "";
  }
  StringBuilder builder=new StringBuilder();
  builder.append(elements[0]);
  boolean skippedFirst=false;
  for (  String s : elements) {
    if (skippedFirst) {
      builder.append(separator);
      builder.append(s);
    }
 else {
      skippedFirst=true;
    }
  }
  return builder.toString();
}

public static String implode ( String [ ] elements , String separator ) { if ( elements == null ) { return null ; } if ( elements . length == 0 ) { return "" ; } StringBuilder builder = new StringBuilder ( ) ; builder . append ( elements [ 0 ] ) ; boolean skippedFirst = false ; for ( String s : elements ) { if ( skippedFirst ) { builder . append ( separator ) ; builder . append ( s ) ; } else { skippedFirst = true ; } } return builder . toString ( ) ; }
serializes a string array with the specified separator
