I prefer to answer codeka as it is a very simple and probably the most efficient way to do something. However, as you can see, this is not the easiest to implement when you need it.
I have something very similar as an extension method, so you can call SubArray and it will behave like a substring on a line.
Something like:
public static T[] SubArray<T>(this T[] array, int startIndex, int length) {
You can implement several other overloads, for example:
public static T[] SubArray<T>(this T[] array, int startIndex) {
Joe enos
source share