public static String padString(String s,int fieldSize){
  StringBuffer buf=new StringBuffer(s);
  while (buf.length() < fieldSize) {
    buf.append(" ");
  }
  return buf.toString();
}

public static String padString ( String s , int fieldSize ) { StringBuffer buf = new StringBuffer ( s ) ; while ( buf . length ( ) < fieldSize ) { buf . append ( " " ) ; } return buf . toString ( ) ; }
adjusts string to be a certain number of characters by adding spaces to the end of the string .
