ArrayList myList = new ArrayList(); for(int i=0;i<20;i++) { myList.Add(i); } int myIndex = myList.BinarySearch(3);