Share via


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

Remarks

See Implementation of database providers and extensions for more information and examples.

Constructors

IndentedStringBuilder()

Properties

IndentCount

Gets the current indent level.

Length

The current length of the built string.

Methods

Append(Char)

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

Append(FormattableString)

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

Append(IEnumerable<Char>)

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

Append(IEnumerable<String>)

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

Append(String)

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

AppendJoin(IEnumerable<String>, String)

Concatenates the members of the given collection, using the specified separator between each member, and then appends the resulting string,

AppendJoin(String, String[])

Concatenates the members of the given collection, using the specified separator between each member, and then appends the resulting string,

AppendLine()

Appends a new line to the string being built.

AppendLine(FormattableString)

Appends the current indent, the given string, and 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.

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.

SuspendIndent()

Temporarily disables all indentation. Restores the original indentation when the returned object is disposed.

ToString()

Returns the built string.

Applies to