Open sandboxFocus

Constructor UnsafeStringBuilder

UnsafeStringBuilder(int, bool)

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
int capacity

The capacity of the new UnsafeStringBuilder.

bool throwOnOverflow

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

UnsafeStringBuilder(char*, int, bool)

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
char* buffer

Pointer to the buffer.

int size

Number of char in the buffer.

bool throwOnOverflow

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