public static String padRight(String s,int length){
  if (s.length() > length) {
    throw new RuntimeException(s + " cannot be padded to length " + length+ ", it is too long");
  }
  String t=new String(s);
  for (int i=0; i < length - s.length(); i++) {
    t+=" ";
  }
  return t;
}

public static String padRight ( String s , int length ) { if ( s . length ( ) > length ) { throw new RuntimeException ( s + " cannot be padded to length " + length + ", it is too long" ) ; } String t = new String ( s ) ; for ( int i = 0 ; i < length - s . length ( ) ; i ++ ) { t += " " ; } return t ; }
returns a string that is the given string padded on the right to the given length .
