Sub Array - CSharp System

CSharp examples for System:Array Slice

Description

Sub Array

Demo Code

// MassSpectrometry is free software: you can redistribute it and/or modify it
using System.Linq;
using System.Collections.Generic;
using System;//from   w w  w .  j ava  2  s. com

public class Main{
        public static T[] SubArray<T>(this T[] data, int index, int length)
        {
            T[] result = new T[length];
            Array.Copy(data, index, result, 0, length);
            return result;
        }
}

Related Tutorials