Table of Contents

ReplaceNonAlloc Method

ReplaceNonAlloc(string, SpanList<char>, SpanList<char>, int, bool)

public static string ReplaceNonAlloc(this string original, SpanList<char> fromList, SpanList<char> toList, int maxPossibleLength = -1, bool clearArrayPoolBuffer = false)

Parameters

original string
fromList SpanList<char>
toList SpanList<char>
maxPossibleLength int

When not supplied, automatically estimated by the following formula: (original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)

clearArrayPoolBuffer bool

true to fill shared buffer by default value when return buffer to ArrayPool<T>.

Returns

string

ReplaceNonAlloc(ReadOnlySpan<char>, SpanList<char>, SpanList<char>, int, bool)

public static string ReplaceNonAlloc(this ReadOnlySpan<char> original, SpanList<char> fromList, SpanList<char> toList, int maxPossibleLength = -1, bool clearArrayPoolBuffer = false)

Parameters

original ReadOnlySpan<char>
fromList SpanList<char>
toList SpanList<char>
maxPossibleLength int

When not supplied, automatically estimated by the following formula: (original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)

clearArrayPoolBuffer bool

true to fill shared buffer by default value when return buffer to ArrayPool<T>.

Returns

string