title: is there a .Each() (or .ForEach() ) iterator in the .Net standard library?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/200574/linq-equivalent-of-foreach-for-ienumerablet">LINQ equivalent of foreach for IEnumerable&lt;T&gt;</a>  </p>
  </blockquote>
  
  
  
  <p>I'm wondering whether there is a method for IEnumerable like the following .Each() in the .Net library</p>
  
  <pre><code>var intArray = new [] {1, 2, 3, 4};
  intArrary.Each(Console.WriteLine);
  </code></pre>
  
  <p>I know I can use a <code>foreach</code> loop or easily write an extension method like this:</p>
  
  <pre><code>public static class EnumerableExtensions
  {
      public static void Each&lt;T&gt;(this IEnumerable&lt;T&gt; enumberable, Action&lt;T&gt; action)
      {
          foreach (var item in enumberable)
          {
              action(item);
          }
      }
  }
  </code></pre>
  
  <p>But I'm hoping not to create my own method to mess up code if there is already such an extension method in the library. And something like .Each() (with a few overloadings which can take conditions as extra params) is heavily needed by programmers, and there should already be one. Am I correct?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Ruby developers may recognize it as a .each() iterator. And that's what I hope to have in C#. Maybe C# can have more iterator methods like those in Ruby.</p>