<br /> int[] Departments = new int[4] { 2, 3, 4, 5 };<br />
if(x "Not IN" Departments) { }
int[] Departments = new int[4] { 2, 3, 4, 5 }; if (Departments.Contains(3)) { MessageBox.Show("Yes!"); }
BinarySearch
int[] Departments = new int[4] { 2, 3, 4, 5 }; if (Array.BinarySearch(Departments, 3) >= 0) { //Yes Present }
if (!Departments.Contains(3)) { MessageBox.Show("The value 3 is not in Departments".") }
System.Collections.Generic.SortedList
System.Collections.Generic.SortedDictionary
System.Collections.Generic.Dictionary
Dictionary
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)