When I run this code I keep getting “Identifier Expected” at line 16 (I AM VERY NEW TO CODING BTW)
code snippet
public static void Main(string[] args)
{
string str = "The quick brown fox jumps over the lazy dog.";
string Typed = "";
int idx = 1;
Console.WriteLine(str);
while (Typed != str)
{
char Letter = str[idx];
if (Console.ReadKey().Key == ConsoleKey.(Letter))
{
Typed = Typed + Letter;
Console.WriteLine(Typed);
}
}
}
I am trying to make it so if you press the letter next in the sentence, it will print what you have typed so far, but I won’t work.