2 using System.Collections.Generic;
10 public static class ArrayExtensions
20 public static bool CompareContents<T>(
this T[] CurrentArray, T[] CompareWith)
22 if (CurrentArray.Length != CompareWith.Length)
27 for (
int i = 0; i < CurrentArray.Length; i++)
29 if (!EqualityComparer<T>.Default.Equals(CurrentArray[i], CompareWith[i]))
return false;
36 public static T[] Concat<T>(
this T[] x, T[] y)
38 if (x == null)
throw new ArgumentNullException(
"x");
39 if (y == null)
throw new ArgumentNullException(
"y");
40 int oldLen = x.Length;
41 Array.Resize<T>(ref x, x.Length + y.Length);
42 Array.Copy(y, 0, x, oldLen, y.Length);
53 public static void Fill<T>(
this T[] x, T FillValue)
55 for (
int i = 0; i < x.Length; i++)
69 public static void Fill<T>(
this T[] x, T FillValue,
int StartPos)
71 for (
int i = 0; StartPos < x.Length; i++)