IndentedStringBuilder Class

Definition

A thin wrapper over StringBuilder that adds indentation to each line built.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public class IndentedStringBuilder
type IndentedStringBuilder = class
Public Class IndentedStringBuilder
Inheritance
IndentedStringBuilder

Constructors

IndentedStringBuilder()

Properties

Length

The current length of the built string.

Methods

Append(String)

Appends the current indent and then the given string to the string being built.

AppendLine()

Appends a new line to the string being built.

AppendLine(String)

Appends the current indent, the given string, and a new line to the string being built.

If the given string itself contains a new line, the part of the string after that new line will not be indented.

AppendLines(String, Boolean)

Separates the given string into lines, and then appends each line, prefixed by the current indent and followed by a new line, to the string being built.

Clear()

Resets this builder ready to build a new string.

DecrementIndent()

Decrements the indent.

IncrementIndent()

Increments the indent.

Indent()

Creates a scoped indenter that will increment the indent, then decrement it when disposed.

ToString()

Returns the built string.

Applies to