Java String Pad Left lPad(String input, String replace, int length)

Here you can find the source of lPad(String input, String replace, int length)

Description

l Pad

License

Open Source License

Declaration

public static String lPad(String input, String replace, int length) 

Method Source Code

//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);
    }
}

Related

  1. lpad(Object str, int len, String padding)
  2. lpad(String base, int len, String pad)
  3. lpad(String input, char padding, int length)
  4. lpad(String input, int length)
  5. lpad(String input, String padChar, int finalLength)
  6. lpad(String s, char addChar, int length)
  7. lpad(String s, int len, char ch)
  8. lpad(String s, int len, String padc)
  9. lpad(String s, int length, char pad)