I need to have a switch statement that will switch through a list of titles.
Would it be best to have a string[], enum, list, etc?
The list will constant and the values will not change.
And how would I implement an enum that switches through string values?
string[]won’t work because you can’tswitchon it and have each case be an element at index n.List<string>won’t work for the same reasonsenumis rather standard practice, so I hear.For an example of what I talk about in the first two instances:
Presents the compiler error:
And gladly, as I can’t imagine why someone would implement it this way.