C#C
C#3y ago
dond~

❔ Getting property from object based on input

Is it possible to create a function that would look something like this? Here I already have the object and I know for sure that the property actually exists. I'm quite new to C#, so I don't know if this is actually possible
private void(string propertyName)
{
   Console.WriteLine(myObject.propertyName.toString());
}
Was this page helpful?