title: C# how to add to the index of an array in a foreach / for loop?
body: <p>C# newbie and confused as to why this isn't working.</p>
  
  <p>Suppose I have an array of {1 , 2 , 3}.</p>
  
  <p>How would I loop through this array to change the values by a set increment, for example if the increment is 1:</p>
  
  <p>{1 , 2 , 3} becomes {2 , 3 , 4}</p>
  
  <p>and if its 2 it becomes {3 , 4 , 5} etc.</p>
  
  <p>Here is my attempt - </p>
  
  <pre><code>foreach (int i in ls)
  {
  int index = i + increment;
  }
  </code></pre>