内容简介:翻译自:https://stackoverflow.com/questions/11162361/c-sharp-liststring-to-listobject-conversion
所有,我精神崩溃了(这不是问题).我想转换List<string []>列出<
object []>
List<string[]> parameters = GetParameters(tmpConn, name); List<object[]> objParams = parameters.OfType<object[]>();
这是行不通的,但除非我忘记使用这种方法进行转换(不需要Lambdas)?
谢谢你的时间.
你想使用类似的东西:
List<object[]> objParams = parameters.OfType<object[]>().ToList();
或者在C#4.0中,只是
List<object[]> objParams = parameters.ToList<object[]>();
要么
List<object[]> objParams = parameters.ConvertAll(s => (object[])s);
翻译自:https://stackoverflow.com/questions/11162361/c-sharp-liststring-to-listobject-conversion
以上所述就是小编给大家介绍的《C#列表到列表转换》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- python – 将dict列表转换为dicts字典的优雅方式
- 在F#中将字符串列表转换为浮点数/整数
- Python笔记(二):列表+列表数据处理+函数
- python创建列表和向列表添加元素方法
- JavaScript进阶系列-类型转换、隐式类型转换
- Android 多国语言转换 Excel 和 Excel 转换为 string
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Building Web Reputation Systems
Randy Farmer、Bryce Glass / Yahoo Press / 2010 / GBP 31.99
What do Amazon's product reviews, eBay's feedback score system, Slashdot's Karma System, and Xbox Live's Achievements have in common? They're all examples of successful reputation systems that enable ......一起来看看 《Building Web Reputation Systems》 这本书的介绍吧!