List of utility methods to do String Align Left
String | alignLeft(CharSequence cs, int width, char c) align Left if (null == cs) return null; int length = cs.length(); if (length >= width) return cs.toString(); return new StringBuilder().append(cs).append(dup(c, width - length)).toString(); |
String | alignLeft(String sLine, int iSize) align Left if (sLine.length() > iSize) { return sLine.substring(0, iSize); } else { return sLine + getWhiteString(iSize - sLine.length()); |
String | alignLeft(String str, int length) align Left return alignLeft(str, length, false);
|
String | alignLeft(String str, int size) align Left return alignLeft(str, size, ' '); |
String | alignLeft(String substring, int totalWidth, char fill) Returns a string of the specified length where the substring is located to the left, padded with a character on the right. if (substring.length() > totalWidth) { return substring.substring(0, totalWidth); } else { return substring + repeat("" + fill, totalWidth - substring.length()); |
String | alignLeft(String val, char pad, int width) align Left if (val == null) val = ""; if (val.length() > width) { val = "*" + val.substring(0, width - 1); return val; while (val.length() < width) val = val + pad; ... |