【发布时间】:2012-09-14 20:07:21
【问题描述】:
有没有办法计算字符串表达式的结果,例如
mystring = "2*a+32-Math.Sin(6)" 动态知道 a 是我拥有的变量,可能有一些动态解决方案或使用 System.Reflection
string mystring = "2*a+32-Math.Sin(6)"`;
decimal result = SomeMethod(mystring,3); // where a = 3 for example
【问题讨论】:
标签: c#