PostSharpAPI ReferencePost­Sharp.​Patterns.​FormattersUnsafe­String­BuilderUnsafe­String­Builder
Open sandboxFocus

UnsafeStringBuilder Constructor

UnsafeStringBuilder(Int32, Boolean)

Initializes a new UnsafeStringBuilder and allocates a new buffer.

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

The capacity of the new UnsafeStringBuilder.

Boolean 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*, Int32, Boolean)

Initializes a new UnsafeStringBuilder 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.

Int32 size

Number of char in the buffer.

Boolean throwOnOverflow

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