FormatNonAlloc Method
- Namespace
- SatorImaging.UnityFundamentals
FormatNonAlloc(string, SpanList<char>, SpanList<char>, bool)
public static string FormatNonAlloc(this string template, SpanList<char> tokens, SpanList<char> replacements, bool clearArrayPoolBuffer = false)
Batch replace with no unnecessary memory allocation.
Parameters
template
stringtokens
SpanList<char>Tokens must start wtih
{
and end with}
.replacements
SpanList<char>clearArrayPoolBuffer
booltrue
to fill shared buffer by default value when return buffer to ArrayPool<T>.
Returns
FormatNonAlloc(ReadOnlySpan<char>, SpanList<char>, SpanList<char>, bool)
public static string FormatNonAlloc(this ReadOnlySpan<char> template, SpanList<char> tokens, SpanList<char> replacements, bool clearArrayPoolBuffer = false)
Batch replace with no unnecessary memory allocation.
Parameters
template
ReadOnlySpan<char>tokens
SpanList<char>Tokens must start wtih
{
and end with}
.replacements
SpanList<char>clearArrayPoolBuffer
booltrue
to fill shared buffer by default value when return buffer to ArrayPool<T>.