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

◆ Concat() [5/12]

static string System.String.Concat ( params object?[] args)
inlinestatic

Definition at line 1584 of file String.cs.

1585 {
1586 if (args == null)
1587 {
1588 throw new ArgumentNullException("args");
1589 }
1590 if (args.Length <= 1)
1591 {
1592 object obj;
1593 if (args.Length != 0)
1594 {
1595 obj = args[0]?.ToString();
1596 if (obj == null)
1597 {
1598 return Empty;
1599 }
1600 }
1601 else
1602 {
1603 obj = Empty;
1604 }
1605 return (string)obj;
1606 }
1607 string[] array = new string[args.Length];
1608 int num = 0;
1609 for (int i = 0; i < args.Length; i++)
1610 {
1611 num += (array[i] = args[i]?.ToString() ?? Empty).Length;
1612 if (num < 0)
1613 {
1614 throw new OutOfMemoryException();
1615 }
1616 }
1617 if (num == 0)
1618 {
1619 return Empty;
1620 }
1621 string text = FastAllocateString(num);
1622 int num2 = 0;
1623 foreach (string text2 in array)
1624 {
1626 num2 += text2.Length;
1627 }
1628 return text;
1629 }
static readonly string Empty
Definition String.cs:29
static void FillStringChecked(string dest, int destPos, string src)
Definition String.cs:1560
static string FastAllocateString(int length)

References System.array, System.String.Empty, System.String.FastAllocateString(), System.String.FillStringChecked(), System.String.Length, System.obj, and System.text.