I have been searching for about an hour and simply can't find any solutions to this. I want each row from my .txt-file to be added to my list as long as it starts with the same number. The problem lies within "line.Substring(0, 1)" and i dont know how to solve it. Perhaps you understand what i want to acheive.
using (StreamReader file = new StreamReader(schedulePathDays))
{
string line;
while ((line.Substring(0, 1) = file.ReadLine()) == thisDay.ToString())
{
exercisesRow.Add(line);
}
}
string.StartsWith()
? – Lloyd 22 mins ago(line.Substring(0, 1) = file.ReadLine())
is wrong. Did you mean(file.ReadLine().Substring(0, 1))
? – Nolonar 22 mins agoline.SubString
before even assigning anything to line. – Nolonar 16 mins ago