কম্পিউটার

Console.C# এ পরিষ্কার পদ্ধতি


C#-এ Console.Clear পদ্ধতিটি কনসোল বাফার এবং ডিসপ্লে তথ্যের সংশ্লিষ্ট কনসোল উইন্ডো পরিষ্কার করতে ব্যবহৃত হয়।

সিনট্যাক্স

নিচের সিনট্যাক্স −

public static void Clear ();

উদাহরণ

আসুন এখন কনসোল প্রয়োগ করার আগে একটি উদাহরণ দেখি। সাফ পদ্ধতি -

using System;
public class Demo {
   public static void Main(){
      Uri newURI1 = new Uri("https://www.tutorialspoint.com/");
      Console.WriteLine("URI = "+newURI1);
      Console.WriteLine("String representation = "+newURI1.ToString());
      Uri newURI2 = new Uri("https://www.tutorialspoint.com/jquery.htm#abcd");
      Console.WriteLine("\nURI = "+newURI2);
      Console.WriteLine("String representation = "+newURI2.ToString());
      if(newURI1.Equals(newURI2))
         Console.WriteLine("\nBoth the URIs are equal!");
      else
         Console.WriteLine("\nBoth the URIs aren't equal!");
      Uri res = newURI1.MakeRelativeUri(newURI2);
      Console.WriteLine("Relative uri = "+res);
}
}

আউটপুট

এটি Console.Clear() −

ব্যবহার করার আগে নিম্নলিখিত আউটপুট তৈরি করবে
URI = https://www.tutorialspoint.com/
String representation = https://www.tutorialspoint.com/
URI = https://www.tutorialspoint.com/jquery.htm#abcd
String representation = https://www.tutorialspoint.com/jquery.htm#abcd
Both the URIs aren't equal!
Relative uri = jquery.htm#abcd

উদাহরণ

আসুন এখন কনসোল প্রয়োগ করার একই উদাহরণ দেখি। সাফ পদ্ধতি −

using System;
public class Demo {
   public static void Main(){
      Uri newURI1 = new Uri("https://www.tutorialspoint.com/");
      Console.WriteLine("URI = "+newURI1);
      Console.WriteLine("String representation = "+newURI1.ToString());
      Uri newURI2 = new Uri("https://www.tutorialspoint.com/jquery.htm#abcd");
      Console.WriteLine("\nURI = "+newURI2);
      Console.WriteLine("String representation = "+newURI2.ToString());
      if(newURI1.Equals(newURI2))
         Console.WriteLine("\nBoth the URIs are equal!");
      else
         Console.WriteLine("\nBoth the URIs aren't equal!");
      Uri res = newURI1.MakeRelativeUri(newURI2);
      Console.WriteLine("Relative uri = "+res);
      Console.Clear();
      Console.WriteLine("Console cleared now!");
   }
}

আউটপুট

এটি নিম্নলিখিত আউটপুট −

তৈরি করবে
Console cleared now!

  1. HTML DOM console.clear() পদ্ধতি

  2. C# এ Console.SetBufferSize() পদ্ধতি

  3. Console.ResetColor() পদ্ধতি C# এ

  4. C# এ Console.MoveBufferArea() পদ্ধতি