What is equivalent to NSDictionary in C #?

What is equivalent to NSDictionary in C #?

Is this a collection?

+6
source share
2 answers

Its System.Collections.Generic.Dictionary<,>
To set an object (e.g. setObject:forKey: , you use:

 Dictionary[Key] = Object; 

To get an object (e.g. objectForKey: , you use:

 var Object = Dictionary[Key]; 
+13
source

You can also use the HashTable class:

Example:

 HashTable dict = new HashTable(); dict.Add("key", object); 
+1
source

Source: https://habr.com/ru/post/903498/


All Articles