Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear the entire console window?

Tags:

c#

window

console

I am making a console window RPG, yet I'm having problems clearing the entire console window. Is there a way for me to clear the entire console window with one command?

like image 517
zimooo2 Avatar asked Jun 04 '11 17:06

zimooo2


People also ask

What commands clear the console?

In computing, CLS (for clear screen) is a command used by the command-line interpreters COMMAND.COM and cmd.exe on DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows and ReactOS operating systems to clear the screen or console window of commands and any output generated by them.

How do I clear my screen output?

Clearing the Screen: system("CLS"); When the screen is cleared in Visual C++, the cursor is moved to the upper left corner of the screen. To clear the screen in Visual C++, utilize the code: system("CLS"); The standard library header file <stdlib.


1 Answers

You can use the Clear() method:

Console.Clear(); 
like image 117
keyboardP Avatar answered Sep 20 '22 00:09

keyboardP