G
Guest
If I have a string variable that contains the name of a property, how can I
evaluate that string in code to be used as a property?
For example:
public struct myData
{
public string first_item;
public string next_item;
}
myData x;
string myItem = "first_item";
x.myItem <----- This is where I want the myItem evaluated so it understands
this is a property of x.
Thanks!
evaluate that string in code to be used as a property?
For example:
public struct myData
{
public string first_item;
public string next_item;
}
myData x;
string myItem = "first_item";
x.myItem <----- This is where I want the myItem evaluated so it understands
this is a property of x.
Thanks!