how to remove all previous code in terminal c# code example Example: c# clear console read chache while(Console.KeyAvailable) { Console.ReadKey(true); }