C#-এ Uri.Equals() পদ্ধতি সমতার জন্য দুটি Uri দৃষ্টান্তের তুলনা করে।
সিনট্যাক্স
নিচের সিনট্যাক্স −
public override bool Equals (object comparand);
উপরে, প্যারামিটার তুলনা হল Uri দৃষ্টান্ত বা বর্তমান উদাহরণের সাথে তুলনা করার জন্য একটি URI শনাক্তকারী।
উদাহরণ
এখন Uri.Equals() পদ্ধতি -
প্রয়োগ করার জন্য একটি উদাহরণ দেখা যাকusing System;
public class Demo {
public static void Main(){
Uri newURI1 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI1);
Uri newURI2 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("Both the URIs are equal!");
else
Console.WriteLine("Both the URIs aren't equal!");
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেURI = https://www.tutorialspoint.com/index.htm URI = http://www.tutorialspoint.com/index.htm Both the URIs aren't equal!
উদাহরণ
এখন Uri.Equals() পদ্ধতি -
প্রয়োগ করার জন্য আরেকটি উদাহরণ দেখা যাকusing System;
public class Demo {
public static void Main(){
Uri newURI1 = new Uri("https://www.tutorialspoint.com/index.htm");
Console.WriteLine("URI = "+newURI1);
Uri newURI2 = new Uri("https://www.tutorialspoint.com/");
Console.WriteLine("URI = "+newURI2);
if(newURI1.Equals(newURI2))
Console.WriteLine("Both the URIs are equal!");
else
Console.WriteLine("Both the URIs aren't equal!");
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেURI = https://www.tutorialspoint.com/index.htm URI = https://www.tutorialspoint.com/ Both the URIs aren't equal!