Java String Indent Format indent(StringBuilder buffer, int d)

Here you can find the source of indent(StringBuilder buffer, int d)

Description

Appends the specified number of space charcter to a string buffer and returns it.

License

Open Source License

Parameter

Parameter Description
buffer the buffer.
d number of spaces.

Return

the buffer.

Declaration

public static StringBuilder indent(StringBuilder buffer, int d) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*ww w  .ja  v a  2s  .  c om*/
     * Appends the specified number of space charcter to a string buffer and returns it.
     * 
     * @param buffer the buffer.
     * @param d number of spaces.
     * @return the buffer.
     */
    public static StringBuilder indent(StringBuilder buffer, int d) {
        for (int i = 0; i < d; i++) {
            buffer.append(' ');
        }
        return buffer;
    }
}

Related

  1. indent(String text, String indentation, char indentationChar, int indentationLevel, int indentationSize, boolean requiresExtraIndentationOnFirstLine)
  2. indent(String value, int spaces)
  3. indent(StringBuffer buffer, int depth)
  4. indent(StringBuffer sb, int indentLevel)
  5. indent(StringBuilder b, int i)
  6. indent(StringBuilder builder, int indent)
  7. indent(StringBuilder builder, int indent)
  8. indent(StringBuilder builder, int times)
  9. indent(StringBuilder sb, int indent)