Skip to content

Operator Mapping

Compare
Choose a tag to compare
@datchung datchung released this 14 May 03:08
· 5 commits to master since this release

Support operator mapping.

Example:

ExpressionEvaluator.SetOperatorMap(new Dictionary<string, string>
{
    {"+", "plus"},
    {"*", "times"},
    {"/", "divideBy"},
});

// Returns 6
int result = ExpressionEvaluator.Evaluate<int>("(1 plus 2) times 2");