Use the dictionary.
Mini example with different dictionary features:
var myDict = new Dictionary<string, string>() { { "key1", "value1" }, { "key2", "value2" }, }; myDict.Add("key3", "value3"); if(myDict.Keys.Contains("key1")) { Console.WriteLine("key1 is present in myDict"); Console.WriteLine($"its value is={myDict["key1"]}"); } else { Console.WriteLine("key1 is NOT present in myDict"); } Console.WriteLine(); if (myDict.Keys.Contains("key4")) { Console.WriteLine("key4 is present in myDict"); } else { Console.WriteLine("key4 is NOT present in myDict"); } Console.WriteLine(); foreach (var element in myDict) { Console.WriteLine($"key={element.Key},{element.Value}"); } Console.WriteLine(); Console.WriteLine($"Количество элементов {myDict.Count}");
Conclusion:

Dictionaries are not only string, begin to study with this example, and then move towards the study of other options.
Related Links:
Dictionary<string, string>- tym32167