当前位置:网站首页>Basic knowledge points of dictionary
Basic knowledge points of dictionary
2022-07-05 04:55:00 【yaohuiyaoo】
1. Using dictionaries (Dictionary)
System.Collections.Generic;// Namespace
2. A dictionary is a mapping from a set of keys to a set ; Any key is unique , Key cannot be empty reference , If the value is of reference type , Can be null ;key and value Can be of any type
3.Dictionary< type 1, type 2> d=new Dictionary< type 1, type 2>();
4. Additive elements
d.Add( data 1, data 2);
3. adopt key Look for the element
d.Containskey( key )// Whether there is a value corresponding to the key change
4. adopt keyvaluepair Traverse keys and values
d.key: key
d.value: value
5. Traverse all keys
Dictionary< key , value >.KeyCollection keys=d.keys;
6. Traverse all values
Dictionary< key , value >.valueCollection values=d.Value;
7. Delete the specified key value
d.Remove( key )
Other common properties and methods
compare: Get to determine whether there is an equal in the dictionary
Count: Number of key value pairs
Item: Gets or sets the value of the specified key
keys: The set of keys
values: Collection of values
add: Add key value
Clear: Remove all keys and values
Contains Key: Determines whether the specified key is included
ContainsValue: Determine whether to include the specified value
Gettype: Get key value type
边栏推荐
- #775 Div.1 B. Integral Array 数学
- 猿人学第一题
- AutoCAD - graphic input and output
- Understand encodefloatrgba and decodefloatrgba
- 中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
- [groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
- Unity get component
- Flink cluster configuration
- AutoCAD - continuous annotation
- English topic assignment (27)
猜你喜欢

CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1

Minor spanning tree

Autocad-- dynamic zoom
![[Business Research Report] Research Report on male consumption trends in other economic times -- with download link](/img/08/7ea490c46c3f64af3e78d07b19b3e3.jpg)
[Business Research Report] Research Report on male consumption trends in other economic times -- with download link
![[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)](/img/2b/933586b6feff1d48c5bee11cd734ba.jpg)
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)

AutoCAD - scaling

669. Prune binary search tree ●●

质量体系建设之路的分分合合

2021 higher education social cup mathematical modeling national tournament ABCD questions - problem solving ideas - Mathematical Modeling

3dsmax scanning function point connection drawing connection line
随机推荐
Unity parallax infinite scrolling background
China needle coke industry development research and investment value report (2022 Edition)
AutoCAD - scaling
The first topic of ape Anthropology
[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)
Detailed introduction of OSPF header message
CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1
Special information | finance, accounting, audit - 22.1.23
2021 Higher Education Club Cup mathematical modeling national tournament ABCD problem - problem solving ideas
Special information | real estate and office buildings - 22.1.9
中国艾草行业研究与投资前景预测报告(2022版)
JMeter -- distributed pressure measurement
Inline built-in function
[groovy] closure (closure call | closure default parameter it | code example)
Introduce Hamming distance and calculation examples
AutoCAD - stretching
3dsmax2018 common operations and some shortcut keys of editable polygons
Number theoretic function and its summation to be updated
Séparation et combinaison de la construction du système qualité
Autocad-- Real Time zoom