Java String Pad Left lpad(String str, char pad, int len)

Here you can find the source of lpad(String str, char pad, int len)

Description

lpad

License

Open Source License

Declaration

public static String lpad(String str, char pad, int len) 

Method Source Code

//package com.java2s;

public class Main {
    public static String lpad(String str, char pad, int len) {
        while (str.length() < len) {
            str = pad + "" + str;
        }//from   w ww. ja  v a2s.c  o  m
        return str;
    }
}

Related

  1. lpad(String s, int len, String padc)
  2. lpad(String s, int length, char pad)
  3. lpad(String s, int width)
  4. lpad(String s, String fill, int len)
  5. lpad(String src, int length, char padding)
  6. lPad(String str, int len, char pad)
  7. lpad(String str, int len, char padding)
  8. LPad(String str, int length, String chr)
  9. lPad(String str, int length, String padString)