title: T[] parameter in string[].Foreach()
body: <p>I'm just getting used to using lambdas and all of that good stuff. However, I am not aware of what argument I need to provide in this case.</p>
  
  <p>I am attempting to modify I string to replace all instances of an entry in a dictionary with it's value, nothing too fancy, I could do this with a simple <code>foreach</code> loop but I'm trying to use this as a learning exercise.</p>
  
  <p>My code so far is as follows:</p>
  
  <pre><code>        string maskString = Masks[alias];
          Regex regex = new Regex(@"({[\w+|\d]+})");
          MatchCollection matches = regex.Matches(maskString);
          string[] constants = matches.Cast&lt;Match&gt;().Select(m =&gt; m.Value).ToArray();
          string maskedString = "";
          if (constants.All(constant =&gt; Constants.ContainsKey(constant)))
          {
              constants.ForEach(constant =&gt; maskedString = maskedString.Replace(constant, Constants[constant]));
          }
  </code></pre>
  
  <p>However, I am receiving this error: <code>There is no argument given that corresponds to the required formal parameter 'action' of 'Array.ForEach&lt;T&gt;(T[], Action&lt;T&gt;)'</code>. It seems to me that I am providing the action in the form of a <code>lambda</code> expression, but I have no idea why it wants another array or what array I should give it.</p>
  
  <p>I have tried providing it with <code>null</code>,<code>string[]</code> and <code>new [] {typeof(string)}</code> but these just cause more errors.</p>
  
  <p>Is it possible for me to conduct this operation using this structure or would it be more practical just to use a traditional <code>foreach</code> loop?</p>