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
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public class DynamicString : DynamicArray<char>
Constructors
DynamicString()
Create a DynamicString string with the default capacity.
Declaration
public DynamicString()
DynamicString(int)
Allocate an empty dynamic string with the given number of characters allocated.
Declaration
public DynamicString(int capacity)
Parameters
Type | Name | Description |
---|---|---|
int | 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 |