How can I find the index of an item in a list without looping through it?
Currently this doesn\'t look very nice - searching through the list for the same item twice
For simple types you can use "IndexOf" :
List arr = new List(); arr.Add("aaa"); arr.Add("bbb"); arr.Add("ccc"); int i = arr.IndexOf("bbb"); // RETURNS 1.