Finding class in array - how?

Hi all,

I have an array of custom class instances.

Each class has many properties, among them Name as String

Is it possible to get a specific class instance by its name?

I looked at IndexOf but I’m not hitting the right idea …

Thanks

Markus

Perhaps I’m misunderstanding, but you can’t look up arrays by name, only by index. So you’ll have to loop through the entire array and check the name property of the class to find the one you want.

Or you could set up a Dictionary and set the Key to the Name and the value to the class instance. Then you could look it up by name.

Nice. Thanks Paul.