Use Afk Expression Library (Afk link)
and try following code it will solve your problem as I sorted out.
Required NameSpace
using Afk.Expression;
Your code for sending expression as string to library evaluator
string str1 = "x > 0";
string str2 = "y < 1";
int x = 10;
int y = 0;
var st1=str1.Replace("x",x.ToString());
var st2 = str2.Replace("y", y.ToString());
if (Eval(st2) && Eval(st1))
{
//checked
}
Eval Method evaluate mathematical and conditional expression
bool Eval(string st)
{
ExpressionEval eval = new ExpressionEval(st);
return Convert.ToBoolean(eval.Evaluate().ToString());
}
As well read for more other libraries that you can utilize for your as such problems.