C#通用列表初始化? [英] C# generic list initialization?
本文介绍了C#通用列表初始化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前有一个我需要执行操作的字符串数组(contains()方法会非常有帮助)我想使用列表结构。是否可以使用字符串值在VS 2005中初始化列表?我不能在不使用add()方法的情况下获取数据。
3.0显然会允许:
I currently have a string array that I need to perform operations on(the contains() method would be very helpful ) and I''d like to use the list structure. Is it possible to initilize a list in VS 2005 with string values in it? I can''t get data in without using the add() method.
3.0 apparently would allow:
展开 | 选择 | Wrap | 行号
推荐答案
我目前有一个我需要执行操作的字符串数组(contains()方法会非常有用)我想使用列表结构。是否可以使用字符串值在VS 2005中初始化列表?我不能在不使用add()方法的情况下获取数据。
3.0显然会允许:
I currently have a string array that I need to perform operations on(the contains() method would be very helpful ) and I''d like to use the list structure. Is it possible to initilize a list in VS 2005 with string values in it? I can''t get data in without using the add() method.
3.0 apparently would allow:
展开 | 选择 | Wrap | 行号
感谢您的帮助。我设法让它也起作用:
Thanks for the help. I managed to get it to work also as:
展开 | 选择 | Wrap | 行号
谢谢寻求帮助。我设法让它也起作用:
Thanks for the help. I managed to get it to work also as:
展开 | 选择 | Wrap | 行号
这篇关于C#通用列表初始化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文