Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReplaceAllInChunk()

unsafe void System.Text.StringBuilder.ReplaceAllInChunk ( int[] replacements,
int replacementsCount,
StringBuilder sourceChunk,
int removeCount,
string value )
inlineprivate

Definition at line 2005 of file StringBuilder.cs.

2006 {
2007 if (replacementsCount <= 0)
2008 {
2009 return;
2010 }
2011 fixed (char* value2 = value)
2012 {
2013 long num = (long)(value.Length - removeCount) * (long)replacementsCount;
2014 int num2 = (int)num;
2015 if (num2 != num)
2016 {
2017 throw new OutOfMemoryException();
2018 }
2020 int indexInChunk = replacements[0];
2021 if (num2 > 0)
2022 {
2024 }
2025 int num3 = 0;
2026 while (true)
2027 {
2030 num3++;
2031 if (num3 >= replacementsCount)
2032 {
2033 break;
2034 }
2035 int num5 = replacements[num3];
2036 if (num2 != 0)
2037 {
2038 fixed (char* value3 = &sourceChunk.m_ChunkChars[num4])
2039 {
2041 }
2042 }
2043 else
2044 {
2045 indexInChunk += num5 - num4;
2046 }
2047 }
2048 if (num2 < 0)
2049 {
2050 Remove(chunk.m_ChunkOffset + indexInChunk, -num2, out chunk, out indexInChunk);
2051 }
2052 }
2053 }
unsafe void ReplaceInPlaceAtChunk(ref StringBuilder chunk, ref int indexInChunk, char *value, int count)
void MakeRoom(int index, int count, out StringBuilder chunk, out int indexInChunk, bool doNotMoveFollowingChars)

References System.Runtime.Serialization.Dictionary, System.Text.StringBuilder.MakeRoom(), System.ComponentModel.Remove, System.Text.StringBuilder.ReplaceInPlaceAtChunk(), and System.value.

Referenced by System.Text.StringBuilder.Replace().