I was following this article
And I came up with this code:
string FileName = \"C:\\\\test.txt\";
using (StreamReader sr = new StreamReader(FileNam
I took a more compact approach to split an input resulting from a text area into a list of string . You can use this if suits your purpose.
the problem is you cannot split by \r\n so i removed the \n beforehand and split only by \r
var serials = model.List.Replace("\n","").Split('\r').ToList<string>();
I like this approach because you can do it in just one line.
This worked for me.
using System.IO;
//
string readStr = File.ReadAllText(file.FullName);
string[] read = readStr.Split(new char[] {'\r','\n'},StringSplitOptions.RemoveEmptyEntries);