13 internal static class ArrayExtensions
30 public static T[] Add<T>(
this T[] array, T value)
37 Array.Resize(ref array, array.Length + 1);
40#if NETCOREAPP3_1_OR_GREATER
43 array[array.Length - 1] = value;
67 public static T[] RemoveRange<T>(
this T[] array,
int index,
int count)
69 if (array.Length - 1 < index)
75 T[] newArray =
new T[array.Length - count];
76 for (
int i = 0; i < array.Length; i++)
80 newArray[i] = array[i];
82 else if (i + count < array.Length)
84 newArray[i] = array[i + count];
103 public static int GetEntryContains(
this string[] array,
string value)
107 for (
int i = 0; i < array.Length; i++)
109 if (array[i].Contains(value))
128 public static string[] RemoveEmptyEntries(
this string[] array)
130 string[] newArray = Array.Empty<
string>();
132 for (
int i = 0; i < array.Length; i++)
134 if (!
string.IsNullOrWhiteSpace(array[i]))
136 newArray = newArray.Add(array[i]);