Java tutorial
//package com.java2s; public class Main { public static String padRight(String s, int n, String c) { return String.format("%1$-" + n + "s", s).replaceAll(" ", c); } }