So basically I wrote my little Add
extension method for array types.
using System;
using System.Linq;
public static class Extensions
{
publ
You may change code like this:
public static class Extensions
{
public static T[] Add(this T[] _self, T item)
{
return _self.Concat(new T[] { item }).ToArray();
}
}
public class Program
{
public static void Main()
{
string[] test = { "Hello" };
test = test.Concat(new string[] { "cruel" }).ToArray();
test = test.Add("but funny");
Console.WriteLine(String.Join(" ", test) + " world");
}
}
As a side note - usage will be same as Concat method.