Java String Indent Format indent(int numSpaces)

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

Description

indent

License

Open Source License

Parameter

Parameter Description
numSpaces the number of spaces to use for the indentation;

Return

a string of blank spaces of the specified length.

Declaration

public static String indent(int numSpaces) 

Method Source Code

//package com.java2s;

public class Main {
    /**// w  w w .j a  va  2 s  .co  m
     * @return a string of blank spaces of the specified length.
     * <br/><br/>
     * @param numSpaces  the number of spaces to use for the indentation;
     */
    public static String indent(int numSpaces) {
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < numSpaces; ++i)
            buffer.append(" ");
        return buffer.toString();
    }
}

Related

  1. indent(int n)
  2. indent(int nb)
  3. indent(int nSpaces)
  4. indent(int number)
  5. indent(int numSpaces)
  6. indent(int tabCount)
  7. indent(String in)
  8. indent(String in)
  9. indent(String input, int depth, int start)