public static String arrayToDelimitedString(Object[] arr,String delim){
  if (arr == null) {
    return "";
  }
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < arr.length; i++) {
    if (i > 0) {
      sb.append(delim);
    }
    sb.append(arr[i]);
  }
  return sb.toString();
}

public static String arrayToDelimitedString ( Object [ ] arr , String delim ) { if ( arr == null ) { return "" ; } StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i > 0 ) { sb . append ( delim ) ; } sb . append ( arr [ i ] ) ; } return sb . toString ( ) ; }
convenience method to return a string array as a delimited ( e . g . csv ) string . e . g . useful for tostring ( ) implementations .
