Here you can find the source of rightPaddedBaseString(String bases, int length)
public static String rightPaddedBaseString(String bases, int length)
//package com.java2s; //License from project: Open Source License public class Main { public static String rightPaddedBaseString(String bases, int length) { return rightPaddedString(bases, length, '-'); }//from www.j a v a 2s . c om public static String rightPaddedString(String string, int length, char paddingChar) { if (string.length() > length) { System.err.println("WARNING: String to pad is longer than expected length. Return original string."); return string; } if (string.length() == length) return string; return string.concat(String.format("%0" + (length - string.length()) + "d", 0).replace('0', paddingChar)); } }