Utils/Runtime/Array.cs
Alexander Filippov fe555652c3 First commit
2021-06-27 14:46:18 +02:00

25 lines
503 B
C#

using System;
namespace Agoxandr.Utils
{
public static class Array
{
public static T[] Append<T>(this T[] array, T item)
{
if (array == null)
{
return new T[] { item };
}
T[] result = new T[array.Length + 1];
for (int i = 0; i < array.Length; i++)
{
result[i] = array[i];
}
result[array.Length] = item;
return result;
}
}
}