title: fill an array in C#
body: <p>In Java there are about 18 a static "fill" methods in the class Arrays that serve to assign one value to each element in an array. I'm looking for an equivalent in C# to achieve the same thing but I'm not finding anything with the same compactness:</p>
  
  <p>1) ForEach as I understand passes elements in the array by value so I can't change them</p>
  
  <p>2) Repeat from Enumerable creates a new array, it seems to be overhead to create a new array and then copy each element from the array</p>
  
  <p>3) a for-loop isn't pretty, which I guess is why the Java folks introduced this compact notation to begin with</p>
  
  <p>4) The Clear method from the Array class can set everything to zero, but then how do I convert zero to the non-zero value I want?</p>
  
  <p>To demonstrate Java's syntax consider this code that prints three times the number 7:</p>
  
  <pre><code>int[] iii = {1, 2, 3};
  Arrays.fill(iii, 7);
  for (int i : iii) {
      System.out.println(i);
  }
  </code></pre>