C# : Data collection to keep string?
-
30-09-2019 - |
Question
Any Data Collection to keep the strings? I want to know any other data collection that can keep string, because enum cannot keep string.
Solution
List<string>
Or
StringCollection
Should do...
http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringcollection.aspx
OTHER TIPS
How about ICollection<string>
or List<string>
or a static array of strings (string[]
)?
System.Collections.Specialized.StringCollection
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow