title: Correct form to Slice an Array In C#
body: <p>i wanted to ask how to Slice an array without using Array.Copy.
  I'll give you an example of what i want to achieve so you can understand me.</p>
  
  <p>Let's say i have this Array. called Original</p>
  
  <p>[ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 ]</p>
  
  <p>i want to get a copy array from an starting index given some length, lets say i want element one to element 6 i want the code to perform the task such as</p>
  
  <pre><code>int startIndex = 0;
  int lenght= 5;
  int[] CopyArray = ArrayFromRange(Original, startIndex, length);
  </code></pre>
  
  <p>then copyArray would be:</p>
  
  <p>[ 1 | 2 | 3 | 4 | 5 ]
  i do not want to use Array.Copy because i will loop this to get subsequent slices</p>
  
  <p>so i would do</p>
  
  <pre><code>int length = 3;
  for(int i = 0; i &lt; OriginalArray.Length; i++)
  {
       int[] CopyArray = ArrayFromRange(OriginalArray, i, length);
       // perform some operations
  }
  </code></pre>
  
  <p>This would give me an array of 4 elements every time the loop executes it and then I'd do some operations. But if I did <code>Array.Copy</code> it would throw an <code>OutOfBoundsException</code> when the i in the loop gets the value 13 it would try to copy the array[15] which does not exists. I want to avoid these kind of errors.</p>
  
  <p>I'm developing on Winforms, .Net 4.0</p>