Maha

Maha

  • NA
  • 0
  • 325.1k

Console.Clear();

Sep 13 2013 5:52 AM
I wish to know the function of Console.Clear();. I have usual black colour console window. If Console.Clear(); was comment out output was blue colour XXXXX in black colour console window.

If Console.Clear(); was uncommented output was only yellow colour Console window no XXXXX at all.

using System;

class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Blue;

Console.WriteLine("XXXXX");

Console.BackgroundColor = ConsoleColor.Yellow;

Console.Clear();

Console.ReadKey();
}
}


Answers (6)