cdm/src/main/java/ucar/unidata/util/StringUtil2.java
public static String padRight(String s, int desiredLength,
                                String padString) {
    StringBuilder ret = new StringBuilder(s);
    while (ret.length() < desiredLength) {
      ret.append(padString);
    }
    return ret.toString();
  }
public static String padRight(String s, int desiredLength,
                                String padString) {
    StringBuilder ret = new StringBuilder(s);
    while (ret.length() < desiredLength) {
      ret.append(padString);
    }
    return ret.toString();
  }
public static String padRight ( String s , int desiredLength , String padString ) { StringBuilder ret = new StringBuilder ( s ) ; while ( ret . length ( ) < desiredLength ) { ret . append ( padString ) ; } return ret . toString ( ) ; }
Pad the given string with padString on the right up to the given length.

@param s             String to pad
@param desiredLength ending length
@param padString     String to pad with (e.g, " ")
@return padded String
Pad the given string with padString on the right up to the given length .