C# Dictionary字典使用for循环遍历
Dictionary<string, string> dict = new Dictionary<string, string>();
for (int i = 0; i < dict.Count; i++) { (int key, string value) = dict.ElementAt(i); Console.WriteLine($"key={key},value={dict[key]}"); }
Dictionary<string, string> dict = new Dictionary<string, string>();
for (int i = 0; i < dict.Count; i++) { (int key, string value) = dict.ElementAt(i); Console.WriteLine($"key={key},value={dict[key]}"); }