List of utility methods to do String Left Align
String | leftAlign(int totalWidth, String s) left Align return String.format("%1$-" + totalWidth + "s", s); |
String | leftAlign(String s, int width) left Align String r = s; int n = width - s.length(); for (int i = 0; i < n; i++) { r += ' '; return r; |
String | leftAlign(String text, int width) Appends spaces until length of text is at least width. return rightPad(text, width, ' '); |
StringBuilder | leftAlign(StringBuilder in, int len) Left aligns some text in a StringBuilder N.B. int sfx = len - in.length(); if (sfx <= 0) { return in; if (sfx > SPACES_LEN) { sfx = SPACES_LEN; in.append(SPACES.substring(0, sfx)); ... |