Variable condition in if statement

Hi

It looks like this may not be possible but…

I would like to code a variable condition in a if statement.
For example I have an if statement that will sometimes use one condition and sometimes two conditions.

If(var == 1){
//do something
}

Or

If(var2 == 3){
//do something
}

Or

If(var == 1 and var2 == 3 ){
//do something
}

So I would like to know if I can construct the condition before with something like this

var condition:String = “var == 1 and var2 == 3”;
If([condition]) {
//do something
}

Thanks in advance

Martin