Java tutorial
//package com.java2s; public class Main { public static String fillStringOnTail(String strValue, char ch, int iSign) { try { StringBuffer strTemp = new StringBuffer(); strTemp.append(strValue); int iDifference = iSign - strValue.length(); if (iDifference <= 0) return strValue; for (int i = 0; i < iDifference; i++) strTemp.append(ch); return strTemp.toString(); } catch (Exception ex) { return ""; } } }