title: C# foreach string array
body: <pre><code>class DM_Matrix {
       public string[] DMInput_Name = new string[] {}; 
       public string[] DMOutput_Name = new string [] {};
       public int[] DMInput = new int[] { 99, 1, 2, 3, 4 };
       public int[] DMOutput = new int[] { 99, 1, 2, 3, 4 };              
  }
          
  public void Initialize() {
       foreach (var i in DM_Matrix.DMInput_Name) {
            CrestronConsole.PrintLine(&quot;[DM.Module.Input_Name&quot; 
                 + DM_Matrix.DMInput_Name[i]);
       }
  }
  </code></pre>
  <p>Compiler error on &quot;i&quot;:</p>
  <blockquote>
  <p>&quot;(local variable) string i</p>
  <p>ERROR cannot implicitly convert type 'string' to 'int'&quot;</p>
  </blockquote>
  <p>I'm trying to print every the whole DM.Module.Input_Name array</p>
  <p>I've tried to set use &quot;int i&quot; instead of &quot;var i&quot; or cast i from string to integer buy no joy. Not sure why &quot;i&quot; is recognised as string. In my understanding it should be recognised as &quot;int&quot; for the array.</p>