TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hakan Axheim
NA
201
33k
How to check a List for values
Jan 22 2021 9:32 PM
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.
Reply
Answers (
3
)
Convert webcam image into binary
Crystal Report printing using button by where clause.