In PHP you can do the following to access a variable:
$foobar1 = 00.00;
$foobar2 = 11.11;
$foobar3 = 22.22;
$i = 2;
echo ${'foobar' . $i}; //Prints 11.11
I want to do the same in C# but I can't seem to get this to work:
double foobar1 = 00.00;
double foobar2 = 11.11;
double foobar3 = 22.22;
int i = 2;
Print("foobar" + i); //Should print 11.11
Any ideas? I have tried a few different searches but I can't seem to find what I'm looking for.
Cheers!
double[]orList<double>. If you really need a mapping from the name to the value you could use aDictionary<string, double>.