A
Arkion
Hi ng,
I would like to search an array of structs for an object whose myName
field (a string) equals the given input search string. Is this
possible to do with IndexOf? Here's an example:
---------------------
public struct SomeRecord
{
string myName;
int idata;
float fdata;
}
SomeRecord[] records = new SomeRecord[10];
// Load array with some data...
// Look for first SomeRecord object whose myName field equals "John"
int index = records.IndexOf("John");
I would like to search an array of structs for an object whose myName
field (a string) equals the given input search string. Is this
possible to do with IndexOf? Here's an example:
---------------------
public struct SomeRecord
{
string myName;
int idata;
float fdata;
}
SomeRecord[] records = new SomeRecord[10];
// Load array with some data...
// Look for first SomeRecord object whose myName field equals "John"
int index = records.IndexOf("John");