Android String Indent indent(int level)

Here you can find the source of indent(int level)

Description

indent

License

Apache License

Declaration

public static final String indent(int level) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final String indent(int level) {
        return indent(level, 4);
    }/*from w  w  w . j av  a 2  s. c o m*/

    public static final String indent(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();
    }
}

Related

  1. indent(int level, int spaces)
  2. getIndent(String text)
  3. appendIndentString(StringBuffer appendToMe, int level)
  4. getIndentStringWithLevel(int level)