MetalamaAPI documentationFlashtrace APIFlashtrace.​FormattersUnsafe­String­BuilderUnsafe­String­Builder
Open sandboxFocus

UnsafeStringBuilder Constructor

UnsafeStringBuilder(Int32, Boolean)

Initializes a new instance of the UnsafeStringBuilder class and allocates a new buffer.

Declaration
public UnsafeStringBuilder(int capacity = 2048, bool throwOnOverflow = true)
Parameters
Type Name Description
System.Int32 capacity

The capacity of the new UnsafeStringBuilder.

System.Boolean throwOnOverflow

true if an System.OverflowException should be thrown when the buffer capacity is insufficient, false if the Append method should return false without exception.

UnsafeStringBuilder(Char*, Int32, Boolean)

Initializes a new instance of the UnsafeStringBuilder class with a pre-allocated buffer.

Declaration
public UnsafeStringBuilder(char *buffer, int size, bool throwOnOverflow = true)
Parameters
Type Name Description
System.Char* buffer

Pointer to the buffer.

System.Int32 size

Number of char in the buffer.

System.Boolean throwOnOverflow

true if an System.OverflowException should be thrown when the buffer capacity is insufficient, false if the Append method should return false without exception.