List of utility methods to do String Indent
String | indent(int level) indent return indent(level, 4);
|
String | indent(int level, int spaces) indent StringBuilder result = new StringBuilder(); for (int i = 0; i < level; i++) { for (int j = 0; j < spaces; j++) { result.append(" "); return result.toString(); |
String | getIndent(String text) Get the whitespace that is the prefix of the given text String ret = ""; char chTemp; String strTemp; boolean boolA, boolB; for (int i = 0; i < text.length(); i++) { boolA = false; boolB = false; chTemp = text.charAt(i); ... |
StringBuffer | appendIndentString(StringBuffer appendToMe, int level) Appends spaces to the supplied StringBuffer, returns the same StringBuffer. while (level-- > 0) appendToMe.append(' '); return appendToMe; |
String | getIndentStringWithLevel(int level) Appends spaces to the supplied String StringBuffer rt = new StringBuffer(level); return appendIndentString(rt, level).toString(); |