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

◆ Insert()

string System.String.Insert ( int startIndex,
string value )
inline

Definition at line 1958 of file String.cs.

1959 {
1960 if ((object)value == null)
1961 {
1962 throw new ArgumentNullException("value");
1963 }
1964 if ((uint)startIndex > Length)
1965 {
1966 throw new ArgumentOutOfRangeException("startIndex");
1967 }
1968 int length = Length;
1969 int length2 = value.Length;
1970 if (length == 0)
1971 {
1972 return value;
1973 }
1974 if (length2 == 0)
1975 {
1976 return this;
1977 }
1978 int length3 = length + length2;
1980 Buffer.Memmove(ref text._firstChar, ref _firstChar, (nuint)startIndex);
1981 Buffer.Memmove(ref Unsafe.Add(ref text._firstChar, startIndex), ref value._firstChar, (nuint)length2);
1982 Buffer.Memmove(ref Unsafe.Add(ref text._firstChar, startIndex + length2), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(length - startIndex));
1983 return text;
1984 }
char _firstChar
Definition String.cs:35
static string FastAllocateString(int length)

References System.String._firstChar, System.String.FastAllocateString(), System.length, System.String.Length, System.length2, System.length3, System.Buffer.Memmove(), System.startIndex, System.text, and System.value.