Java Utililty Methods String Indent Format

List of utility methods to do String Indent Format

Description

The list of methods to do String Indent Format are organized into topic(s).

Method

voidindent(final StringBuffer buffer, final String text, final int indent)
Appends the given (multi-line) text to the buffer with the given indent count.
if (text != null) {
    for (final String row : text.split(NL_S)) {
        indent(buffer, indent);
        buffer.append(row);
        nl(buffer);
    ;
voidindent(final StringBuilder aSb, final String aIndentString)
Changes the indentation of the string, a requested string is appended after every EOFs in the string.
replaceString(aSb, "\n", "\n" + aIndentString);
voidindent(final StringBuilder buf, int level)
Add string for indentation to given level to buffer.
while (level > 0) {
    buf.append("    ");
    --level;
voidindent(final StringBuilder s, final int depth)
indent
for (int i = depth - 1; i >= 0; i--)
    s.append("  ");
voidindent(final StringBuilder sb, final int indent)
Appends to a given StringBuilder the given indents depending on the indent level.
for (int i = 0; i < indent; i++) {
    sb.append(LOG_OUT_INDENT);
Stringindent(int count)
Create an indentation of a given number of spaces.
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < count; i++) {
    buffer.append(" ");
return buffer.toString();
Stringindent(int i, String s)
indent
String spaces = repeat(i, ' ');
return spaces + s.replace("\n", "\n" + spaces);
Stringindent(int indent)
indent
char[] chars = new char[indent * _INDENTSIZE];
for (int i = 0; i < chars.length; i++) {
    chars[i] = ' ';
return new String(chars);
Stringindent(int indent)
indent
switch (indent) {
case 8:
    return ("        ");
case 7:
    return ("       ");
case 6:
    return ("      ");
case 5:
...
Stringindent(int indent)
indent
if (LAST_indent == indent)
    return LAST_INDENT;
if (indent == 0)
    return ""; 
if (indent == 1)
    return " "; 
if (indent == 2)
    return "  "; 
...