Here you can find the source of LPad(String str, int length, String chr)
public static String LPad(String str, int length, String chr)
//package com.java2s; //License from project: Open Source License public class Main { public static String LPad(String str, int length, String chr) { StringBuilder sb = new StringBuilder(str); while (sb.length() < length) sb.insert(0, chr);//from w ww. j a va 2 s . com return sb.toString(); } }