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

◆ Insert() [17/20]

unsafe StringBuilder System.Text.StringBuilder.Insert ( int index,
string? value,
int count )
inline

Definition at line 1017 of file StringBuilder.cs.

1018 {
1019 if (count < 0)
1020 {
1021 throw new ArgumentOutOfRangeException("count", SR.ArgumentOutOfRange_NeedNonNegNum);
1022 }
1023 int length = Length;
1024 if ((uint)index > (uint)length)
1025 {
1026 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_Index);
1027 }
1028 if (string.IsNullOrEmpty(value) || count == 0)
1029 {
1030 return this;
1031 }
1032 long num = (long)value.Length * (long)count;
1033 if (num > MaxCapacity - Length)
1034 {
1035 throw new OutOfMemoryException();
1036 }
1038 fixed (char* value2 = value)
1039 {
1040 while (count > 0)
1041 {
1043 count--;
1044 }
1045 return this;
1046 }
1047 }
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.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.count, System.Runtime.Serialization.Dictionary, System.index, System.length, System.Text.StringBuilder.Length, System.Text.StringBuilder.MakeRoom(), System.Text.StringBuilder.MaxCapacity, System.Text.StringBuilder.ReplaceInPlaceAtChunk(), and System.value.

Referenced by System.Globalization.HebrewNumber.Append(), System.Xml.Schema.FacetsChecker.FacetsCompiler.FinishFacetCompile(), System.Xml.XmlCharacterData.InsertData(), System.Globalization.IdnMapping.PunycodeDecode(), and System.Xml.XmlCharacterData.ReplaceData().