StringBuilder

Description

sealed class Tinman.Core.Formatting.StringBuilder

Derived from

IInternalBuffer<char [ ]>

Helper class for building (possibly large) string values.

Public / Constructors

String​Builder


public constructor StringBuilder → (1)

initialCapacity opt : int32 = 32

The initial character buffer capacity.

Creates a new instance of StringBuilder.

Public / Methods

Append

10 overloads


public method Append1 → (2)

character in : char

The character to append.

count opt : int32 = 1

Number of times to append character in.

returns → StringBuilder

this

Appends the given character count opt times.


public method Append2 → (1)

characters in : char [ ]

[not-null]
The character array.

returns → StringBuilder

this

Appends the given characters.


public method Append3 → (3)

characters in : char [ ]

[not-null]
The character array.

offset in : int32

[>=0]
Index of first character in characters in to append.

count in : int32

[>=0]
Total number of characters to append.

returns → StringBuilder

this

Appends the given characters.


public method Append4 → (1)

str in : string

The string to append.

returns → StringBuilder

this

Appends the given string.


public method Append5 → (3)

str in : string

The string to append.

offset in : int32

[>=0]
Index of first character in str in to append.

count in : int32

[>=0]
Total number of characters to append.

returns → StringBuilder

this

Appends the given string.


public method Append6 → (1)

builder in : StringBuilder

The string to append.

returns → StringBuilder

this

Appends the given string.


public method Append7 → (1)

value in : bool

The object value.

returns → StringBuilder

this

Appends the string representation of the given boolean value.


public method Append8 → (1)

value in : object

The object value.

returns → StringBuilder

this

Appends the string representation of the given object value.


public method Append9 → (2)

number in : int64

The integer number.

flags opt : FormatFlags = FormatFlags.Default

The number format flags to use.

returns → StringBuilder

this

Appends the string representation of the given integer number.


public method Append10 → (2)

number in : float64

The decimal number.

flags opt : FormatFlags = FormatFlags.Default

The number format flags to use.

returns → StringBuilder

this

Appends the string representation of the given decimal number.

Clear


public method Clear → ()

returns → StringBuilder

this

Clears the content of this StringBuilder.

Newline


public method Newline → (1)

opt : int32 = 1

The number of newline sequences to append.

returns → StringBuilder

this

Appends the given number of newline sequences to this StringBuilder.

Pattern


public method Pattern → (1)

pattern in : string

[not-empty]
The pattern to format (see Format).

returns → Format_StringBuilder

The pattern formatter. Calling Format_StringBuilder.Append will return this StringBuilder.

Appends a formatted pattern to this StringBuilder.

Remove


public method Remove → (2)

offset in : int32

[0..StringBuilder.Length]
Offset to first character to remove.

length in : int32

[0..StringBuilder.Length-offset]
Number of characters to remove.

Removes a portion of the current string data.

Set​Line​Ending


public method SetLineEnding → (1)

lineEnding in : LineEnding

The line ending to use.

returns → StringBuilder

this

Specifies the LineEnding to use for subsequent calls to Newline.

Defaults to LineEnding.LF.

Public / Attributes

Length


public attribute Length → (get)

value : int32

[>=0]
The current string length.

Returns the current string length.