Android Utililty Methods String Indent

List of utility methods to do String Indent


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


Stringindent(int level)
return indent(level, 4);
Stringindent(int level, int spaces)
StringBuilder result = new StringBuilder();
for (int i = 0; i < level; i++) {
    for (int j = 0; j < spaces; j++) {
        result.append(" ");
return result.toString();
StringgetIndent(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);
StringBufferappendIndentString(StringBuffer appendToMe, int level)
Appends spaces to the supplied StringBuffer, returns the same StringBuffer.
while (level-- > 0)
    appendToMe.append(' ');
return appendToMe;
StringgetIndentStringWithLevel(int level)
Appends spaces to the supplied String
StringBuffer rt = new StringBuffer(level);
return appendIndentString(rt, level).toString();