public static String makeLength(String s,int n,boolean bRightJustify){
  int l=s.length();
  if (l == n) {
    return s;
  }
 else   if (l < n) {
    if (bRightJustify) {
      return SPACES.substring(0,n - l) + s;
    }
    return s + SPACES.substring(0,n - l);
  }
 else {
    return s.substring(0,n - 2) + "..";
  }
}

public static String makeLength ( String s , int n , boolean bRightJustify ) { int l = s . length ( ) ; if ( l == n ) { return s ; } else if ( l < n ) { if ( bRightJustify ) { return SPACES . substring ( 0 , n - l ) + s ; } return s + SPACES . substring ( 0 , n - l ) ; } else { return s . substring ( 0 , n - 2 ) + ".." ; } }
a utility for padding out a string with spaces .
