Class StringBuilderPool
Defines a system used to store and retrieve StringBuilder objects.
public class StringBuilderPool : IPool<StringBuilder>
- Inheritance
-
StringBuilderPool
- Implements
- Inherited Members
- Extension Methods
Properties
Pool
Gets a StringBuilderPool that stores StringBuilder.
public static StringBuilderPool Pool { get; }
Property Value
Methods
Get()
Retrieves a stored object of type StringBuilder, or creates it if it does not exist.
public StringBuilder Get()
Returns
- StringBuilder
The stored object, or a new object, of type StringBuilder.
Get(int)
Retrieves a stored object of type StringBuilder, or creates it if it does not exist. The capacity of the StringBuilder will be equal to or greater than capacity
.
public StringBuilder Get(int capacity)
Parameters
capacity
intThe capacity of content in the StringBuilder.
Returns
- StringBuilder
The stored object, or a new object, of type StringBuilder.
Return(StringBuilder)
Returns the object to the pool.
public void Return(StringBuilder obj)
Parameters
obj
StringBuilderThe object to return, of type StringBuilder.
ToStringReturn(StringBuilder)
Returns the contents of the StringBuilder and returns it to the pool.
public string ToStringReturn(StringBuilder obj)
Parameters
obj
StringBuilderThe StringBuilder to return.
Returns
- string
The value of the StringBuilder.