我如何在字典中的密钥列表? [英] How do I get the list of keys in a dictionary?

查看:104
本文介绍了我如何在字典中的密钥列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从来没有得到我想工作的任何代码。



我要的钥匙,而不是值(还)。使用另一个数组被证明是因为我用也删除了太多的工作。


解决方案

 名单,LT ;字符串>键列表=新的List<串GT;(this.yourDictionary.Keys); 


I never gotten any code I tried to work.

I want the keys and not the values (yet). Using another array proved to be too much work as I use remove also.

解决方案

List<string> keyList = new List<string>(this.yourDictionary.Keys);

这篇关于我如何在字典中的密钥列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆