Android String Indent indent(int level, int spaces)

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

Description

indent

License

Apache License

Declaration

public static final String indent(int level, int spaces) 

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);
    }// ww w .  j a va  2s .com

    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)
  2. getIndent(String text)
  3. appendIndentString(StringBuffer appendToMe, int level)
  4. getIndentStringWithLevel(int level)