I want to parse user input in a streamReader. My code is:
string txt = txtin.text ; //<~~ txtin is something like root:x:1:1....
using (TextReader reader = new TextReader( txt))
{
string line = "";
while ((line = reader.ReadLine()) != null)
{
string userName = line.Substring(0, line.IndexOf(':'));
}
}
I get this error:
Cannot create an instance of the abstract class or interface 'System.IO.TextReader'