c# how to clear last command code example Example: c# clear console read chache while(Console.KeyAvailable) { Console.ReadKey(true); }