C# StreamReader save to Array with separator
问题 I´ve got a text file with tabulator separated data. What I need in my C# application is that I read one line from the text file and save them to an array, separate them at the each \t . Then I do the same thing with the next row. My code: StreamReader sr = new StreamReader(dlg.FileName); string s = sr.ReadLine(); Now, I already tried to write the line into an array but that doesn´t work. Does anyone one how to manage this? 回答1: Use the Split method to create an Array of the line string[]