Question: How is it possible to find a specific object from a list?
Lets say i have a function that takes an object and a list that contains objects of this type and returns the number at which position the specific object is found. 

The only way i could think of a solution is to run the list through with a foreach loop, but isn't there a better way?

Thanks

Answer: 
You can use the `IndexOf(T item)` method:

```
myList.IndexOf(myItem);

```

It returns the index of the first occurrence of the item.
You can use method `IndexOf` or if you use a special condition then you can use method

```
public int FindIndex(Predicate<T> match);

```

where match is delegate

```
public delegate bool Predicate<T>(T obj);

```

In fact it is similar to standard C++ algorithm `std::find_if`