Java String Left Justify leftJustify(String str, int width)

Here you can find the source of leftJustify(String str, int width)

Description

left Justify

License

Open Source License

Declaration

public static String leftJustify(String str, int width) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String leftJustify(String str, int width) {
        return suffix(str, width, " ");
    }//from   ww w  .  j  a  v  a2  s.co m

    public static String suffix(String str, int width, String with) {
        StringBuffer ret = new StringBuffer(str);
        while (ret.length() < width)
            ret.append(with);
        return ret.toString();
    }
}

Related

  1. LeftAdjust(String s, int len, char pad)
  2. leftJustify(long v, int width)
  3. leftJustify(String s, int maxLength)
  4. leftJustify(String sourceString, int targetLen, char pad)
  5. leftJustify(String string, int width)
  6. leftJustify(String value, int width)
  7. leftJustifyString(String s, int width)
  8. leftJustifyText(String originalValue, int length, char padCharacter)