কম্পিউটার টিউটোরিয়াল

C#-এ দুটি টাপল তুলনা করা (Compare Tuples)


টাপল তুলনা C# 7.3 এর পরে এসেছে।

C#-এ সমতা অপারেটর (==) ব্যবহার করে সহজে দুটি টাপল তুলনা করা যায়।

মান লইয়ে আমাদের দুটি টাপল আছে −

var one = (x: 1, y: 2); var two = (p: 1, 2: 3, r: 3, s:4);

তুলনা করতে শুধু == অপারেটর ব্যবহার করুন −

if (one == two) Console.WriteLine("Both the tuples are same (values are same).");

কোডটি দেখি −

উদাহরণ

var one = (x: 1, y: 2); var two = (p: 1, 2: 3, r: 3, s:4); if (one == two) Console.WriteLine("Both the tuples are same (values are same)."); lse Console.WriteLine("Both the tuples values are not same.");

  1. আইফোন/আইওএসে দুটি NSDate তুলনা (Compare) করার পদ্ধতি

  2. Notepad++-এ প্লাগইন ব্যবহার করে দুটি ফাইল তুলনা করার পদ্ধতি

  3. দুটি Microsoft Word ডকুমেন্ট তুলনা করার উপায়

  4. WinMerge দিয়ে Windows 10-এ দুটি ফোল্ডারের ফাইল তুলনা করুন সহজে