How can I quickly shift all the items in an array one to the left, padding the end with null?
For example, [0,1,2,3,4,5,6] would become [1,2,3,4,5,6,null]
Ed
You can use the same array as source and destination for fast in-place copy:
static void Main(string[] args) { int[] array = {0, 1, 2, 3, 4, 5, 6, 7}; Array.ConstrainedCopy(array, 1, array, 0, array.Length - 1); array[array.Length - 1] = 0; }