Here you can find the source of min(String in, int len)
public static String min(String in, int len)
//package com.java2s; //License from project: Open Source License public class Main { public static String min(String in, int len) { return min(in, len, ' '); }/*from w w w.j a v a 2 s. c om*/ public static String min(String in, int len, char c) { return padLast(in, len, c); } public static String padLast(String string, int len, char c) { if (string.length() >= len) return string; StringBuilder sb = new StringBuilder(len); sb.append(string); while (sb.length() < len) sb.append(c); return sb.toString(); } public static String toString(char c) { return new String(new char[] { c }); } public static String toString(int[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(short[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(float[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(long[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(double[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(boolean[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(char[] o) { StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(o[0]); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(o[i]); } sb.append(']'); return sb.toString(); } public static String toString(Object o) { return o == null ? "null" : o.toString(); } public static String toString(Object[] o) { if (isEmpty(o)) return "[]"; StringBuilder sb = new StringBuilder(); sb.append('['); sb.append(toString(o[0])); for (int i = 1; i < o.length; i++) { sb.append(','); sb.append(toString(o[i])); } sb.append(']'); return sb.toString(); } public static boolean isEmpty(CharSequence cs) { return cs == null || cs.length() == 0; } public static boolean isEmpty(Object[] o) { return o == null || o.length == 0; } }