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
originalstringfromListSpanList<char>toListSpanList<char>maxPossibleLengthintWhen not supplied, automatically estimated by the following formula:
(original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)clearArrayPoolBufferbooltrueto 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
originalReadOnlySpan<char>fromListSpanList<char>toListSpanList<char>maxPossibleLengthintWhen not supplied, automatically estimated by the following formula:
(original.Length / fromListMinLength + 1) * (toListMaxLength - fromListMinLength)clearArrayPoolBufferbooltrueto fill shared buffer by default value when return buffer to ArrayPool<T>.