Hello guys!
I have an assignment in which I need to clear the console a few times. The company has unit tests which check for console.clear()-s so it’s a no-no,
Do you have any other idea?
Any reason as to why Console.Clear() is not allowed?
It’s just stated in the task’s instructions
Use a tool like JetBrains dotPeek, decompile Console.Clear(), and copy the implementation into your own custom class or use it as an example to build your own version of what they’re doing.
Not very usable but it came to my mind so here is it anyway:
StringBuilder x = new StringBuilder().Append(' ', Console.WindowHeight * Console.WindowWidth) Console.write('n'+ x.ToString()); Console.SetCursorPosition(0, 0);
C# devs
null reference exceptions