C# Dictionary 사용법
Java에 Map이 있다면 C#에서는 비슷한 자료형인 Dictionary가 있습니다. 기본적인 개념은 Java의 HashMap과 동일하게 Key와 Value로 이루어지며 사용은 아래와 같이 할 수 있습니다. // Dictionary 선언 Dictionary myDictionary = new Dictionary(); // 데이터 추가 myDictionary.Add("str1", "Hello"); myDictionary.Add("str2", " World!"); string str1 = null; string str2 = null; // 데이터 획득 방법 #1 str1 = myDictionary["str1"]; // 데이터 획득 방법 #2 myDictionary.TryGetValue("str2", out s..