Android examples for java.lang:String Pad
pad Left with String.format
import android.content.Context; public class Main{ public static String padLeft(Object s, char padChar, int n) { return String.format("%1$" + n + "s", s).replace(' ', padChar); }//from w ww . j a va2 s . c om }