title: How to split a long entered in TextBox control into int array
body: <p>I just started to learn C# and already have a question, maybe quite dumb.</p>
  
  <p>I'm writing a little desktop program (Windows Forms) that checks whether entered bank account number is valid or computes missing control numbers. To check number validity we must multiply each digit in that number by corresponding factor. My problem is:</p>
  
  <p>When I enter whole number (26 digits) in TextBlock control and click Check button I need to parse that number into int array somehow. I saw some examples already and tried</p>
  
  <pre><code>int[] array = new int[26];
  char[] sep = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
  
  String[] numbers = inputWindow.Text.Split(sep);
  
  for (int i = 0; i &lt; 26; i++)
      array[i] = Int32.Parse(numbers[i]);
  </code></pre>
  
  <p>But got FormatException. I also tried </p>
  
  <pre><code>array = inputWindow.Text.Split().Select(h =&gt; Int32.Parse(h)).ToArray());
  </code></pre>
  
  <p>Or something similar but got OverflowException. Int64.Parse resulted in obvious type conversion error. How to accomplish that parsing?</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>EDIT</strong>
  My bad, there was 30 instead of 26, but that actually didn't matter.</p>