I want to test whether a certain string is contained in a short list of strings. Currently the code is like this:
if (new List<string> { "A", "B", "C" }.Contains (str)) {
However, this seems bloated. For instance, iirc, in Java I could simply write {"A", "B", "C"}.Contains(str)
which would be much preferable to the above.
I'm sure there is a better way in C#. Could you point it out?