C# convert a string for use in a logical condition

后端 未结 8 1664
我在风中等你
我在风中等你 2021-01-01 20:40

Is it possible to convert a string to an operator for use in a logical condition.

For example

if(x Convert.ToOperator(\">\") y) {}
8条回答
  •  长情又很酷
    2021-01-01 21:36

    Vici Parser (open-source) may be of help to you. It's a C# expression parser where you can just pass a string containing an expression, and you get the computed result back.

提交回复
热议问题