2 using System.Collections.Generic;
10 public static class ArrayExtensions
13 public static T[] Concat<T>(
this T[] x, T[] y)
15 if (x == null)
throw new ArgumentNullException(
"x");
16 if (y == null)
throw new ArgumentNullException(
"y");
17 int oldLen = x.Length;
18 Array.Resize<T>(ref x, x.Length + y.Length);
19 Array.Copy(y, 0, x, oldLen, y.Length);
30 public static void Fill<T>(
this T[] x, T FillValue)
32 for (
int i = 0; i < x.Length; i++)
45 public static void Fill<T>(
this T[] x, T FillValue,
int StartPos)
47 for (
int i = 0; StartPos < x.Length; i++)
61 public static bool CompareContents<T>(
this T[] CurrentArray, T[] CompareWith)
63 if (CurrentArray.Length != CompareWith.Length)
68 for (
int i = 0; i < CurrentArray.Length; i++)
70 if (!EqualityComparer<T>.Default.Equals(CurrentArray[i], CompareWith[i]))
return false;