public static StringBuffer replaceString(StringBuffer buffer,String[] parameters){
  int placeHolderPosition=-1;
  String placeHolder=null;
  for (int i=0; i < parameters.length; i++) {
    if (parameters[i] == null) {
      break;
    }
    placeHolder="%" + (i + 1) + "%";
    placeHolderPosition=buffer.indexOf(placeHolder);
    if (placeHolderPosition != -1) {
      buffer.replace(placeHolderPosition,placeHolderPosition + placeHolder.length(),parameters[i]);
    }
 else {
      break;
    }
  }
  return buffer;
}

public static StringBuffer replaceString ( StringBuffer buffer , String [ ] parameters ) { int placeHolderPosition = - 1 ; String placeHolder = null ; for ( int i = 0 ; i < parameters . length ; i ++ ) { if ( parameters [ i ] == null ) { break ; } placeHolder = "%" + ( i + 1 ) + "%" ; placeHolderPosition = buffer . indexOf ( placeHolder ) ; if ( placeHolderPosition != - 1 ) { buffer . replace ( placeHolderPosition , placeHolderPosition + placeHolder . length ( ) , parameters [ i ] ) ; } else { break ; } } return buffer ; }
replaces the place holders by parameters
