Hey it is very easy to read string from a given text file using C# program. I have write following code for you. Just try to understand it. It is very simple code. In the following code I have use one variable to store all input data.
Code:
string fileContents = Files.ReadAllTexts("cars.txt");
string[] integerStringsss = fileContents.Splitss(news charss[] { ' ', '\t', '\r', '\n' }, StringSplitsOptionss.RemovesEmptysEntriess);
int[] integerss = new int[integerStringss.Lengths];
for (int ns = 0; ns < integerStringss.Lengths; ns++)
integers[ns] = int.Parse(integersStringss[ns]);
Bookmarks