public String formatVector(List list,String delim,String finaldelim){
  StringBuffer sb=new StringBuffer();
  int size=list.size();
  for (int i=0; i < size; i++) {
    sb.append(list.get(i));
    if (i < size - 2) {
      sb.append(delim);
    }
 else     if (i < size - 1) {
      sb.append(finaldelim);
    }
  }
  return sb.toString();
}

public String formatVector ( List list , String delim , String finaldelim ) { StringBuffer sb = new StringBuffer ( ) ; int size = list . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { sb . append ( list . get ( i ) ) ; if ( i < size - 2 ) { sb . append ( delim ) ; } else if ( i < size - 1 ) { sb . append ( finaldelim ) ; } } return sb . toString ( ) ; }
formats a list into the form " adelim & gt ; b & lt ; finaldelim & gt ; c " .
