Any Data Collection to keep the strings? I want to know any other data collection that can keep string, because enum cannot keep string.
Asked
Active
Viewed 902 times
1
-
3Most collections can store any type of object. The difference between each type of collection is how those objects are stored/written/accessed. – Rob Elliott Dec 03 '10 at 17:35
4 Answers
3
List<string>
Or
StringCollection
Should do...
http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringcollection.aspx

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
-
It's better to use a generic collection rather then non-generic, isn't it? You can use LINQ, etc without addition operations – abatishchev Dec 03 '10 at 17:37
-
@abatishchev - maybe a little, but I wouldn't get excited either way. – Marc Gravell Dec 03 '10 at 17:46
1
How about ICollection<string>
or List<string>
or a static array of strings (string[]
)?

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
0
If you decide to go with WPF or Silverlight and need to databind to it then you should use
ObservableCollection<string>
Although I should point out that string is not mutable.

abatishchev
- 98,240
- 88
- 296
- 433

basarat
- 261,912
- 58
- 460
- 511