Looking for something like
int Result;
DataTable dt2 = new DataTable();
var v = dt2.Compute("3+2-34*12", "");
Result=Convert.ToInt32(v);
the code above, which solves the text base formula. Unfortunately, the code above only works for some basic operators (+,-,/,*). Need a little more complex one (like squareroot, ^ at least).
Could you help me to find something tosolve for a little more complex equations?
You can use Roslyn scripting API for that. Add Microsoft.CodeAnalysis.CSharp.Scripting package and evaluate C# code like this:
Usage:
Note: Scripting API requires .NET Framework 4.6+ or .NET Core 1.1