List of utility methods to do String Indent Format
String | indentString(final int indentSpaces) indent String return SPACES.substring(0, Math.min(NO_OF_SPACES, indentSpaces));
|
String | indentString(int indent) indent String StringBuffer sbuf = new StringBuffer(); for (int i = 0; i < indent; i++) sbuf.append(" "); return sbuf.toString(); |
String | indentString(int indent) indent String if (indent < 0) { return ""; return " ".substring(0, indent); |
String | indentString(String s, char open, char middle, char close) To be used with (open,middle,close)=('[',',',']') for the output of ToStringBuilder.reflectionToString StringBuilder b = new StringBuilder(); int level = 0; for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == open) { b.append(c); b.append("\n"); ++level; ... |
String | indentString(String str, String indent) indent String StringBuilder sb = new StringBuilder(indent); for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); sb.append(ch); if (ch == '\n' && i != str.length() - 1) { sb.append(indent); return sb.toString(); |
void | indentStringBuffer(StringBuffer sb, int indent) add indent to a StringBuffer sb.append(indentString(indent)); |
String | indentText(String text, boolean indentFirstLine) Adds an indentation before every line (optionally the first line can be an exception) of the given string. String result = text != null ? text.replace("\n", "\n" + INDENTATION) : NULL_STR; return indentFirstLine ? (INDENTATION + result) : result; |
String | indentTransform(String in, int indent) add indent to a String StringBuffer sb = new StringBuffer(in.length() + 64 * indent); String IndentString = indentString(indent); for (int i = 0; i < in.length(); i++) { char c = in.charAt(i); switch (c) { case '\n': sb.append(c); if (i < (in.length() - 1)) ... |
void | indentWith(String s) indent With indentStr = indentStr + s; |