net.objecthunter.exp4j.C#中的表达式等价物

时间:2017-04-26 10:00:17

标签: c#

我想知道C#中是否存在等效的JAVA net.objecthunter.exp4j.Expression;

我正在尝试翻译这个JAVA函数函数:

    Expression expression;
    String[] variables;

    public WB_ExpressionScalarParameter(String equation, params String[] vars)
    {
        ExpressionBuilder expressionBuilder = new ExpressionBuilder(equation);
        variables = new String[vars.Length];

        for (int i = 0; i < vars.Length; i++)
        {
            expressionBuilder.variable(vars[i]);
            variables[i] = vars[i];
        }
        try
        {
            expression = expressionBuilder.build();
        }
        catch (Exception e)
        {
            throw new Exception( "Can't parse equation. Please check equation and parameters.");
        }
    }

并且引用了Expresion类型: import net.objecthunter.exp4j.Expression; import net.objecthunter.exp4j.ExpressionBuilder;

这个函数做什么:它需要一个字符串并转换为表达式。如果.NET中有这种类型的表达式吗?

0 个答案:

没有答案