I have a method:
add(int x,int y)
I also have:
int a = 5;
int b = 6;
string s = \"add\";
Is it poss
If the functions are known at compile time and you just want to avoid writing a switch statement.
Setup:
Dictionary> functions =
new Dictionary>();
functions["add"] = this.add;
functions["subtract"] = this.subtract;
Called by:
string functionName = "add";
int x = 1;
int y = 2;
int z = functions[functionName](x, y);