Console.Clear() মেথড কনসোল উইন্ডোর কন্টেন্ট মুছে দেয় এবং কারসরকে টপ-লেফট কোণে (0,0) নিয়ে আসে।
উদাহরণ
using System;
class Program {
static void Main() {
Console.WriteLine("Clearing the screen!");
Console.Clear();
Console.ForegroundColor = ConsoleColor.Blue;
Console.BackgroundColor = ConsoleColor.Yellow;
Console.WriteLine("Screen cleared, colors changed.");
}
}
আউটপুট
(স্ক্রিন ক্লিয়ার হয়ে যায়, শুধু শেষ লাইন থাকে) Screen cleared, colors changed.