Key Value pair in C#

 I want to store KEY VALUE pair in C# and being Java developer, I did not find any HashMap class with C#. Here is the simple example

Dictionary<String, String> detailCodes = new Dictionary<string, string>();
String detailCodeList = ConfigurationManager.AppSettings["DETAIL_CODE_LIST"].ToString();
 if (detailCodeList != null && detailCodeList.Trim().Length > 0) {
            String[] words = detailCodeList.Split(',');
            foreach (String detailCode in words) {
                detailCodes.Add(detailCode, detailCode);
            } // foreach (String detailCode in words)
} // if (detailCodeList != null

 I want to store KEY VALUE pair in C# and being Java developer, I did not find any HashMap class with C#. Here is the simple example Dictionary<String, String> detailCodes = new Dictionary<string, string>(); String detailCodeList = ConfigurationManager.AppSettings[“DETAIL_CODE_LIST”].ToString();  if (detailCodeList != null && detailCodeList.Trim().Length > 0) {             String[] words = detailCodeList.Split(‘,’);             foreach (String detailCode…

Leave a Reply

Your email address will not be published. Required fields are marked *