title: Parse string to int array
body: <p>Hi there I am working on increasing my knowledge of C# and I want to do a simple task but am finding it difficult. </p>
  
  <p>I want to parse each character of a string to an int array.</p>
  
  <pre><code>    int[] d = new int[10];
       private void button1_Click(object sender, EventArgs e)
      {
          s = textBox1.Text;
  
          d[2] = Convert.ToInt32(Convert.ToString(s[1]));
          d[3] = Convert.ToInt32(Convert.ToString(s[2]));
          d[4] = Convert.ToInt32(Convert.ToString(s[3]));
          d[5] = Convert.ToInt32(Convert.ToString(s[4]));
          .....
  </code></pre>
  
  <p>I know the code is wrong but I wanted to show an example. Have looked at Google for the past hour but have found people wanting to display characters in new lines and using if statements to parse. I want something similar to above. Can this be done? Thank you for your time.</p>
  
  <p>I found this line of code in Java which is exactly what I want to do but is there an equivilant? </p>
  
  <pre><code>    d1 = Integer.parseInt(String.valueOf(s.charAt(0)));
  </code></pre>
  
  <p>I now have a new problem that when i submit a number no matter how many numbers i put in it will come back with "Index was outside the bounds of the array." </p>
  
  <p>I also need to limit it to 10 integers in the array d.</p>