Class DynamicString
A mutable string with a size and capacity so you can do string manipulations wile avoiding GC allocs.
Inherited Members
Namespace: UnityEngine.Rendering
Syntax
public class DynamicString : DynamicArray<char>
Constructors
DynamicString()
Create a DynamicString string with the default capacity.
Declaration
public DynamicString()
DynamicString(Int32)
Allocate an empty dynamic string with the given number of characters allocated.
Declaration
public DynamicString(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | capacity | The number of characters to pre-allocate. |
DynamicString(String)
Create a DynamicString given a string.
Declaration
public DynamicString(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| String | s | The string to initialize with. |
Methods
Append(String)
Append a string to the DynamicString. This will not allocate memory if the capacity is still sufficient.
Declaration
public void Append(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| String | s |
Append(DynamicString)
Declaration
public void Append(DynamicString s)
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicString | s |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |