How to convert string formula to a mathematical formula in C#

c#
10,546

Not sure why would you mention a compiler, but the simplest way will be to use a math expression evaluator, for example NCalc.

Share:
10,546

Related videos on Youtube

Justin
Author by

Justin

html-query-plan - Display SQL Server Execution Plans in HTML

Updated on June 04, 2022

Comments

  • Justin
    Justin over 1 year

    If I have a string variable with a formula:

    string myformula = "3 * 5 + Pow(2,3)";
    

    How can I convert this string to a mathematical formula that the compiler can calculate?

    • Admin
      Admin about 12 years
      Finally I got the FLEE library. The tool is free and perfectly fit for this purpose.
    • Clare Macrae
      Clare Macrae about 12 years
      The FLEE library is at flee.codeplex.com, and it does look very good. Why not write your own answer to this question (which is allowed/encouraged), so the question shows as answered, and others can up-vote your answer?