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:
but 2005 won't let me initalize like that. I have a lot of entries and it's silly to add() every one.
I've tried declaring:
which doesn't work either.
Thanks for any help!
3.0 apparently would allow:
Code:
List<string> stuff = new List<string> { "Entry", "Something", "Another" };
I've tried declaring:
Code:
List<string>stuff = new List<string>();
stuff = {"this", "that", "other"};
Thanks for any help!
Comment