I called it RedimAndPreserve because of an equivalent function in VB6/VB.NET which does this.Code:public static Array ReDimAndPreserve(Array inputArray, int newsize) { Array result=(Array)Activator.CreateInstance(inputArray.GetType(), new object[] {newsize}); Array.Copy(inputArray, result, Math.Min(inputArray.Length, result.Length)); return result; }




Reply With Quote