Array slices in C#

You could use ArraySegment<T>. It’s very light-weight as it doesn’t copy the array:

string[] a = { "one", "two", "three", "four", "five" };
var segment = new ArraySegment<string>( a, 1, 2 );

Leave a Comment