From 39214388c847f8166c2ed763ff26444d167aa7ac Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Sat, 9 Dec 2017 15:19:26 +0100 Subject: [PATCH] Added T[].Add() --- Array.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Array.cs b/Array.cs index d294a38..d8910bc 100644 --- a/Array.cs +++ b/Array.cs @@ -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(this T[] a,T e) + { + T[] r = a.Extend(a.Length + 1); + r[a.Length] = e; + return r; + } + } }