Here you can find the source of lPad(String input, String replace, int length)
public static String lPad(String input, String replace, int length)
//package com.java2s; /*/* w w w. ja va 2 s. c om*/ * Copyright (C) 2010 Viettel Telecom. All rights reserved. * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ public class Main { public static String lPad(String input, String replace, int length) { String format = "%" + length + "s"; return String.format(format, input).replace(" ", replace); } }