Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Determine if a Value Exists in an Array without Looping using vb.net .....
Posted
Comments
Kenneth Haugland 23-May-15 6:02am    
Array.ToList().Contains("Somvalue") but you cant really check it without looping through all the values.....

1 solution

Basically, you can't, unless you check each individual element by hand:
C#
if (arr[0] == value) ...
if (arr[1] == value) ...
...
Although (as Kenneth has said) there are Linq extension methods such as Contains which will return a "yes/no" answer, allthey do is "hide" the loop.
 
Share this answer
 
Comments
Member 10521418 23-May-15 6:36am    
okkkkzzz thnnxsss ...
Member 10521418 23-May-15 6:39am    
one more question for both of you ...follow this link.
http://www.codeproject.com/Questions/994247/is-it-possible-to-loop-items-at-a-time?arn=0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900