0
Console.Clear(); not Working in C#?
Whenever I put the Console.Clear(); method inside a statement it never works. For example, if I put Console.Clear(); inside a while loop, it doesn't clear the console. Can someone explain to me why this happens, and possibly tell me a solution to this problem? Thanks in advanced.
2 Réponses
+ 1
First, are you using an ide or the code playground?
Second, what comes before and after the clear? Maybe you're just rewriting the text so it looks the same?
0
Firstly, atm I code on my phone using an app called Dcoder since I don't have a working pc. Secondly, earlier I made a while loop that wrote a variable value to the console, then (it was supposed to) clear the console with Console.Clear(); then increment the variable. This isn't the first time I've encountered this Coder's Crux.
double num = 1;
while(true)
{
Console.WriteLine(num);
Console.Clear();
num += 1;
}