Added T[].Add()

master
Harald Wolff 2017-12-09 15:19:26 +01:00
parent c9385cb467
commit 39214388c8
1 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Collections.Generic;
using System.Threading;
namespace sharp.extensions
{
public static class ArrayExtension
@ -111,5 +112,12 @@ namespace sharp.extensions
return -1;
}
public static T[] Add<T>(this T[] a,T e)
{
T[] r = a.Extend<T>(a.Length + 1);
r[a.Length] = e;
return r;
}
}
}