I've created a list of a class. Here you can see the code:
public class People{
public string name;
public int age;
}
public List<People> peopleInfo = new List<People>();
My problem is that I have for example a name and now I want to know the age. How do I get this data? I can get a name or the age on a specific position by this:
int pos = peopleInfo[0].name;
But how I can do it the inverted way and get the position of name? When I have this it easy to get the age.