可以用DataTable完成简单字符串表达式的计算。

using System;

using System.Data;

namespace Test

{

    class Program

    {

        static void Main(string[] args)

        {

            string exp = "(1+2*3/4)-10/5";

            DataTable dt = new DataTable();

            object m = dt.Compute(exp, "");

        }

    }

 

}

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2019-09-08
  • 2022-12-23
  • 2021-10-23
  • 2021-11-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2021-09-18
  • 2022-12-23
  • 2021-05-22
  • 2021-10-28
  • 2021-10-16
相关资源
相似解决方案