private class ArrayTool{ /// 查询值在数组中的下标 /// 数组 /// 查询的参数 ///下标 public static int ArrayQueryIndex(T[] array, T param) { for (int i = 0; i < array.Length; i++) if (array[i].Equals(param)) return i; return 0; } ///根据下标拆分出新数组 /// 原数组 /// 结束下标 /// 开始下标 ///新数组 public static T[] NewArrayByIndex(T[] array, int EndIndex, int StartIndex) { T[] result = new T[EndIndex - StartIndex + 1]; for (int i = 0; i <= EndIndex - StartIndex; i++) result[i] = array[i + StartIndex]; return result; } }