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

◆ CopyTo() [2/2]

void System.Text.StringBuilder.CopyTo ( int sourceIndex,
Span< char > destination,
int count )
inline

Definition at line 979 of file StringBuilder.cs.

980 {
981 if (count < 0)
982 {
983 throw new ArgumentOutOfRangeException("count", SR.Arg_NegativeArgCount);
984 }
985 if ((uint)sourceIndex > (uint)Length)
986 {
987 throw new ArgumentOutOfRangeException("sourceIndex", SR.ArgumentOutOfRange_Index);
988 }
989 if (sourceIndex > Length - count)
990 {
991 throw new ArgumentException(SR.Arg_LongerThanSrcString);
992 }
994 int num = sourceIndex + count;
995 int num2 = count;
996 while (count > 0)
997 {
998 int num3 = num - stringBuilder.m_ChunkOffset;
999 if (num3 >= 0)
1000 {
1001 num3 = Math.Min(num3, stringBuilder.m_ChunkLength);
1002 int num4 = count;
1003 int num5 = num3 - count;
1004 if (num5 < 0)
1005 {
1006 num4 += num5;
1007 num5 = 0;
1008 }
1009 num2 -= num4;
1010 count -= num4;
1011 new ReadOnlySpan<char>(stringBuilder.m_ChunkChars, num5, num4).CopyTo(destination.Slice(num2));
1012 }
1013 stringBuilder = stringBuilder.m_ChunkPrevious;
1014 }
1015 }
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)

References System.SR.Arg_LongerThanSrcString, System.SR.Arg_NegativeArgCount, System.SR.ArgumentOutOfRange_Index, System.Collections.Generic.Dictionary< TKey, TValue >.CopyTo(), System.count, System.destination, System.Runtime.Serialization.Dictionary, System.Text.StringBuilder.Length, System.Math.Min(), and System.sourceIndex.