কম্পিউটার

অভিধান. C# এ সম্পত্তির মান


C#-এ Dictionary.Values ​​প্রপার্টি ডিকশনারিতে সমস্ত মান আনতে ব্যবহার করা হয়।

সিনট্যাক্স

নিম্নলিখিত বাক্য গঠন −

public System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection Values{ get; }

উদাহরণ

আসুন এখন Dictionary.Values ​​প্রোপার্টি −

বাস্তবায়নের জন্য একটি উদাহরণ দেখি
using System;
using System.Collections.Generic;
public class Demo {
   public static void Main(){
      Dictionary<string, string> dict = new Dictionary<string, string>();
      dict.Add("One", "Kagido");
      dict.Add("Two", "Ngidi");
      dict.Add("Three", "Devillers");
      dict.Add("Four", "Smith");
      dict.Add("Five", "Warner");
      Console.WriteLine("Count of elements = "+dict.Count);
      Console.WriteLine("\nKey/value pairs...");
      foreach(KeyValuePair<string, string> res in dict){
         Console.WriteLine("Key = {0}, Value = {1}", res.Key, res.Value);
      }
      Console.Write("\nAll the values..\n");
      Dictionary<string, string>.ValueCollection allValues=
      dict.Values;
      foreach(string str in allValues){
         Console.WriteLine("Value = {0}", str);
      }
   }
}

আউটপুট

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

তৈরি করবে
Count of elements = 5
Key/value pairs...
Key = One, Value = Kagido
Key = Two, Value = Ngidi
Key = Three, Value = Devillers
Key = Four, Value = Smith
Key = Five, Value = Warner
All the values..
Value = Kagido
Value = Ngidi
Value = Devillers
Value = Smith
Value = Warner

উদাহরণ

এখন Dictionary.Values ​​প্রোপার্টি -

বাস্তবায়নের জন্য আরেকটি উদাহরণ দেখা যাক
using System;
using System.Collections.Generic;
public class Demo {
   public static void Main(){
      Dictionary<int, string> dict = new Dictionary<int, string>();
      dict.Add(1, "Kagido");
      dict.Add(2, "Ngidi");
      dict.Add(3, "Devillers");
      Console.WriteLine("Count of elements = "+dict.Count);
      Console.WriteLine("\nKey/value pairs...");
      foreach(KeyValuePair<int, string> res in dict){
         Console.WriteLine("Key = {0}, Value = {1}", res.Key, res.Value);
      }
      Console.Write("\nAll the values..\n");
      Dictionary<int, string>.ValueCollection allValues= dict.Values;
      foreach(string str in allValues){
         Console.WriteLine("Value = {0}", str);
      }
   }
}

আউটপুট

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

তৈরি করবে
Count of elements = 3
Key/value pairs...
Key = 1, Value = Kagido
Key = 2, Value = Ngidi
Key = 3, Value = Devillers
All the values..
Value = Kagido
Value = Ngidi
Value = Devillers

  1. এইচটিএমএল ডোম বোতাম মান সম্পত্তি

  2. এইচটিএমএল উইন্ডো পেজএক্সঅফসেট প্রপার্টি

  3. এইচটিএমএল উইন্ডো পৃষ্ঠা YOffset সম্পত্তি

  4. HTML DOM মান সম্পত্তি