[Solved] heeelp, i keep getting a read underline under foreach [closed]


Using foreach on a string will produce a sequence of char, so declaring part as a string is not valid. Declare part as char or use var.

do
{
    //string test = questions[qCounter] = objReader.ReadLine();


    string test = question.Split('?')[qCounter];
    qCounter++;

    foreach (char part in test)
    {

        Console.WriteLine(part);
        Console.ReadLine();
    }
} while (objReader.Peek() != -1 && qCounter < quest);

1

solved heeelp, i keep getting a read underline under foreach [closed]