Java String Indent Format indentStr(int level)

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

Description

indent Str

License

Apache License

Declaration

public static String indentStr(int level) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

public class Main {
    private static final String[] XMLIndent = { "", "  ", "    ", "      ", "        ", "          ",
            "            ", "              " };

    public static String indentStr(int level) {
        if (level < XMLIndent.length) {
            return XMLIndent[level];
        } else {//from w  ww.j  a  va2s .c o  m
            return XMLIndent[XMLIndent.length - 1] + indentStr(level + 1 - XMLIndent.length);
        }
    }
}

Related

  1. indentLinesAfterNth(final int skip, final int indent, final String str)
  2. indentMultilineValue(String value, StringBuilder tableInfo, int[] columnWidths, boolean printNull)
  3. indentNextLines(String text, String indent)
  4. indentParagraph(String textBefore, String textToModify)
  5. indentRows(int level, String ss, String indentStr)
  6. indentString(final int indentSpaces)
  7. indentString(int indent)
  8. indentString(int indent)
  9. indentString(String s, char open, char middle, char close)