Hi,
I have a List values = new List();
values.add("0");This
values.add("1");
values.add("9)";
Only values 0 and 9 are valid so therefore I must check if the list above has values that are different from the values 0 and 9. I need help with that from someone that is experienced in C#.
I have tried with this;
This if statement will always be true because I only check for 0 and 9.
if (values.ContainshT("0") && values.Contains("9"))
This if statement will also be true because there is an item that is different from 0 and 9.
if (!values.ContainshT("0") && !values.Contains("9"))
How to check if items exist other than 0 and 9 it is false and if only items 0 and 9 exist then it is true.

Nitin SontakkeRank #264 · 9.6K reputationPosted Jan 22, 2021, 11:59 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Jan 23, 2021, 4:49 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Jan 23, 2021, 12:00 AM EST