ReplaceNonAlloc Method
- Namespace
- SatorImaging.UnityFundamentals
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
stringfromList
SpanList<char>toList
SpanList<char>maxPossibleLength
intWhen not supplied, automatically estimated by the following formula:
(original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)
clearArrayPoolBuffer
booltrue
to fill shared buffer by default value when return buffer to ArrayPool<T>.
Returns
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
intWhen not supplied, automatically estimated by the following formula:
(original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)
clearArrayPoolBuffer
booltrue
to fill shared buffer by default value when return buffer to ArrayPool<T>.