If I have a text file with the string: 100101101
I can read and store this by using the following code:
string text = System.IO.File.ReadAllText(@"writeText.txt");
How can I convert the string into separate numbers and add each number to an array index, do I need to separate each number with a comma? I was thinking I could iterate through the string and for each character convert to an integer and add to array, would this work?
Here is what i am trying:
int[] arrSetup = new int[9];
string text = System.IO.File.ReadAllText(@"writeText.txt");
foreach (char c in text)
{
arrSetup[0] = Int32.Parse(c);
}