title: Converting String array to int (months into numbers)
body: <p>Currently I have an array of 600 months (January to December) and I wanted to create a new array of int's based off of the initial array.</p>
  
  <p>currently I have     ( Ignore any Legacy. as im calling the arrays from a diffrent class)</p>
  
  <pre><code>       for (int i = 0; i &lt; Legacy.Month1.Length; i++)
          {
  
              int[] MonthNo1 = new int[Legacy.Month1.Length];
  
              switch (Legacy.Month1[i])
              {
                  case "January ":
                      MonthNo1[i] = 1;
                      break;
                  case "February ":
                      MonthNo1[i] = 2;
                      break;
                  case "March ":
                      MonthNo1[i] = 3;
                      break;
                  case "April ":
                      MonthNo1[i] = 4;
                      break;
                  case "May":
                      MonthNo1[i] = 5;
                      break;
                  case "June ":
                      MonthNo1[i] = 6;
                      break;
                  case "July ":
                      MonthNo1[i] = 7;
                      break;
                  case "August ":
                      MonthNo1[i] = 8;
                      break;
                  case "September ":
                      MonthNo1[i] = 9;
                      break;
                  case "October":
                      MonthNo1[i] = 10;
                      break;
                  case "November":
                      MonthNo1[i] = 11;
                      break;
                  case "December ":
                      MonthNo1[i] = 12;
                      break;
              }
  
              for (int j = 0; i &lt; MonthNo1.Length; j++)
              {
  
                  Console.WriteLine(MonthNo1[j]);
  
              }
  </code></pre>
  
  <p>Unfortunately this doesn't seem to work.</p>
  
  <p>It successfully outputs the first converted number,  but the other 599 are all blank. On top of that at the end of the process, I get exception</p>
  
  <blockquote>
    <p>System.IndexOutOfRangeException</p>
  </blockquote>
  
  <p>Relating to the <code>Console.WriteLine(MonthNo1[j]);</code> at the bottom of the code.</p>
  
  <p>can anyone see where I am going wrong with this?</p>