public static String padRight(String s,int len,char pad_ch){
  if (s.length() >= len) {
    return s;
  }
 else {
    StringBuilder sb=new StringBuilder();
    int n=len - s.length();
    sb.append(s);
    for (int i=0; i < n; i++) {
      sb.append(pad_ch);
    }
    return sb.toString();
  }
}

public static String padRight ( String s , int len , char pad_ch ) { if ( s . length ( ) >= len ) { return s ; } else { StringBuilder sb = new StringBuilder ( ) ; int n = len - s . length ( ) ; sb . append ( s ) ; for ( int i = 0 ; i < n ; i ++ ) { sb . append ( pad_ch ) ; } return sb . toString ( ) ; } }
returns a string consisting of " s " , plus enough copies of " pad_ch " on the right hand side to make the length of " s " equal to or greater than len ( if " s " is already longer than " len " , then " s " is returned ) .
